Check is_network in the screen object for AJAX requests. Props scribu. fixes #15903

git-svn-id: http://svn.automattic.com/wordpress/trunk@17077 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-12-20 11:57:25 +00:00
parent cb88352144
commit 43a639929f

View File

@ -610,6 +610,11 @@ function is_blog_admin() {
* @return bool True if inside WordPress network administration pages.
*/
function is_network_admin() {
if ( defined('DOING_AJAX') && function_exists('get_current_screen') ) {
$screen = get_current_screen();
return (bool) $screen->is_network;
}
if ( defined( 'WP_NETWORK_ADMIN' ) )
return WP_NETWORK_ADMIN;
return false;