mirror of
git://develop.git.wordpress.org/
synced 2025-02-27 01:52:24 +01:00
is_blog_admin(). fixes #14763
git-svn-id: https://develop.svn.wordpress.org/trunk@15558 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
400c32dd13
commit
b2351693de
@ -14,8 +14,10 @@
|
|||||||
if ( !defined('WP_ADMIN') )
|
if ( !defined('WP_ADMIN') )
|
||||||
define('WP_ADMIN', TRUE);
|
define('WP_ADMIN', TRUE);
|
||||||
|
|
||||||
if ( !defined('WP_NETWORK_ADMIN') )
|
if ( !defined('WP_NETWORK_ADMIN') ) {
|
||||||
define('WP_NETWORK_ADMIN', FALSE);
|
define('WP_NETWORK_ADMIN', FALSE);
|
||||||
|
define('WP_BLOG_ADMIN', TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
if ( isset($_GET['import']) && !defined('WP_LOAD_IMPORTERS') )
|
if ( isset($_GET['import']) && !defined('WP_LOAD_IMPORTERS') )
|
||||||
define('WP_LOAD_IMPORTERS', true);
|
define('WP_LOAD_IMPORTERS', true);
|
||||||
|
@ -553,7 +553,7 @@ function wp_clone( $object ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the current request is in WordPress admin Panel
|
* Whether the current request is for a network or blog admin page
|
||||||
*
|
*
|
||||||
* Does not inform on whether the user is an admin! Use capability checks to
|
* Does not inform on whether the user is an admin! Use capability checks to
|
||||||
* tell if the user should be accessing a section or not.
|
* tell if the user should be accessing a section or not.
|
||||||
@ -569,7 +569,23 @@ function is_admin() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the current request is in WordPress network admin Panel
|
* Whether the current request is for a blog admin screen /wp-admin/
|
||||||
|
*
|
||||||
|
* Does not inform on whether the user is a blog admin! Use capability checks to
|
||||||
|
* tell if the user should be accessing a section or not.
|
||||||
|
*
|
||||||
|
* @since 3.1.0
|
||||||
|
*
|
||||||
|
* @return bool True if inside WordPress network administration pages.
|
||||||
|
*/
|
||||||
|
function is_blog_admin() {
|
||||||
|
if ( defined( 'WP_BLOG_ADMIN' ) )
|
||||||
|
return WP_BLOG_ADMIN;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the current request is for a network admin screen /wp-admin/network/
|
||||||
*
|
*
|
||||||
* Does not inform on whether the user is a network admin! Use capability checks to
|
* Does not inform on whether the user is a network admin! Use capability checks to
|
||||||
* tell if the user should be accessing a section or not.
|
* tell if the user should be accessing a section or not.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user