mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
Assume current user of user ID is not passed. Props filosofo. fixes #11808
git-svn-id: https://develop.svn.wordpress.org/trunk@12650 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1085,15 +1085,12 @@ function remove_role( $role ) {
|
||||
* @return bool True if the user is a site admin.
|
||||
*/
|
||||
function is_super_admin( $user_id = false ) {
|
||||
global $current_user;
|
||||
if ( ! $user_id ) {
|
||||
$current_user = wp_get_current_user();
|
||||
$user_id = ! empty($current_user) ? $current_user->id : 0;
|
||||
}
|
||||
|
||||
if ( !$current_user && !$user_id )
|
||||
return false;
|
||||
|
||||
if ( !$user_id )
|
||||
$user_id = $current_user->id;
|
||||
|
||||
if ( !$user_id )
|
||||
if ( ! $user_id )
|
||||
return false;
|
||||
|
||||
$user = new WP_User($user_id);
|
||||
|
||||
Reference in New Issue
Block a user