Return true for all admin user is multisite is not enabled. see #11644
git-svn-id: https://develop.svn.wordpress.org/trunk@12612 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8a5d801117
commit
03f8d8996d
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user