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: http://core.svn.wordpress.org/trunk@21377 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2012-07-31 17:47:08 +00:00
parent 174dad02bc
commit fed9492cbc

View File

@ -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() ) {