mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
Better is_admin() check from filosofo and pishmishy. fixes #5487
git-svn-id: http://svn.automattic.com/wordpress/trunk@6412 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e0301f76ea
commit
f4b80af89a
@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
define('WP_ADMIN', TRUE);
|
||||||
|
|
||||||
if ( defined('ABSPATH') )
|
if ( defined('ABSPATH') )
|
||||||
require_once( ABSPATH . 'wp-config.php');
|
require_once( ABSPATH . 'wp-config.php');
|
||||||
else
|
else
|
||||||
|
@ -32,9 +32,9 @@ function wp_reset_query() {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function is_admin () {
|
function is_admin () {
|
||||||
global $wp_query;
|
if ( defined('WP_ADMIN') )
|
||||||
|
return WP_ADMIN;
|
||||||
return ($wp_query->is_admin || (stripos($_SERVER['REQUEST_URI'], 'wp-admin/') !== false));
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function is_archive () {
|
function is_archive () {
|
||||||
|
Loading…
Reference in New Issue
Block a user