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:
parent
5ba4a05d29
commit
68073badbc
|
@ -1084,9 +1084,14 @@ function is_super_admin( $user_id = false ) {
|
|||
|
||||
$user = new WP_User($user_id);
|
||||
|
||||
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