Fix is_site_admin() when passing a username. Props francescolaffi. fixes #14046

git-svn-id: http://svn.automattic.com/wordpress/trunk@15328 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-06-25 15:11:36 +00:00
parent 6925cea413
commit 24be098207
1 changed files with 3 additions and 3 deletions

View File

@ -48,10 +48,10 @@ function is_site_admin( $user_login = '' ) {
if ( !$user_id ) if ( !$user_id )
return false; return false;
} else { } else {
$user = new WP_User( null, $user_login) ; $user = get_user_by( 'login', $user_login );
if ( empty( $user->id ) ) if ( empty( $user->ID ) )
return false; return false;
$user_id = $user->id; $user_id = $user->ID;
} }
return is_super_admin( $user_id ); return is_super_admin( $user_id );