Use get_userdata() rather than new WP_User in is_super_admin(), to take advantage of the performance improvements in [21376]. see #21120.
git-svn-id: https://develop.svn.wordpress.org/trunk@21377 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
2c058d3b3a
commit
d69dda48ec
@ -1377,12 +1377,10 @@ function get_super_admins() {
|
||||
* @return bool True if the user is a site admin.
|
||||
*/
|
||||
function is_super_admin( $user_id = false ) {
|
||||
if ( $user_id )
|
||||
$user = new WP_User( $user_id );
|
||||
else
|
||||
$user = wp_get_current_user();
|
||||
if ( ! $user_id )
|
||||
$user_id = get_current_user_id();
|
||||
|
||||
if ( ! $user->exists() )
|
||||
if ( ! $user = get_userdata( $user_id ) )
|
||||
return false;
|
||||
|
||||
if ( is_multisite() ) {
|
||||
|
Loading…
Reference in New Issue
Block a user