is_blog_admin(). fixes #14763

git-svn-id: http://svn.automattic.com/wordpress/trunk@15558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-09-02 15:03:39 +00:00
parent 5711925db5
commit f781ba4824
2 changed files with 21 additions and 3 deletions

View File

@ -14,8 +14,10 @@
if ( !defined('WP_ADMIN') )
define('WP_ADMIN', TRUE);
if ( !defined('WP_NETWORK_ADMIN') )
if ( !defined('WP_NETWORK_ADMIN') ) {
define('WP_NETWORK_ADMIN', FALSE);
define('WP_BLOG_ADMIN', TRUE);
}
if ( isset($_GET['import']) && !defined('WP_LOAD_IMPORTERS') )
define('WP_LOAD_IMPORTERS', true);

View File

@ -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
* 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
* tell if the user should be accessing a section or not.