Fix is_site_admin() when passing a username. Props francescolaffi. fixes #14046
git-svn-id: https://develop.svn.wordpress.org/trunk@15328 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8a95a0d25d
commit
d397a1c20d
@ -48,10 +48,10 @@ function is_site_admin( $user_login = '' ) {
|
||||
if ( !$user_id )
|
||||
return false;
|
||||
} else {
|
||||
$user = new WP_User( null, $user_login) ;
|
||||
if ( empty( $user->id ) )
|
||||
$user = get_user_by( 'login', $user_login );
|
||||
if ( empty( $user->ID ) )
|
||||
return false;
|
||||
$user_id = $user->id;
|
||||
$user_id = $user->ID;
|
||||
}
|
||||
|
||||
return is_super_admin( $user_id );
|
||||
|
Loading…
Reference in New Issue
Block a user