Return true for all admin user is multisite is not enabled. see #11644

git-svn-id: http://svn.automattic.com/wordpress/trunk@12612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-01-06 23:39:40 +00:00
parent 5ba4a05d29
commit 68073badbc
1 changed files with 8 additions and 3 deletions

View File

@ -1084,9 +1084,14 @@ function is_super_admin( $user_id = false ) {
$user = new WP_User($user_id);
$site_admins = get_site_option( 'site_admins', array('admin') );
if ( is_array( $site_admins ) && in_array( $user->user_login, $site_admins ) )
return true;
if ( is_multisite() ) {
$site_admins = get_site_option( 'site_admins', array('admin') );
if ( is_array( $site_admins ) && in_array( $user->user_login, $site_admins ) )
return true;
} else {
if ( $user->has_cap('delete_users') )
return true;
}
return false;
}