WordPress.org

Make WordPress Core

Changeset 21377


Ignore:
Timestamp:
07/31/2012 05:47:08 PM (6 years ago)
Author:
nacin
Message:

Use get_userdata() rather than new WP_User in is_super_admin(), to take advantage of the performance improvements in [21376]. see #21120.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/capabilities.php

    r21375 r21377  
    13781378 */
    13791379function is_super_admin( $user_id = false ) {
    1380     if ( $user_id )
    1381         $user = new WP_User( $user_id );
    1382     else
    1383         $user = wp_get_current_user();
    1384 
    1385     if ( ! $user->exists() )
     1380    if ( ! $user_id )
     1381        $user_id = get_current_user_id();
     1382
     1383    if ( ! $user = get_userdata( $user_id ) )
    13861384        return false;
    13871385
Note: See TracChangeset for help on using the changeset viewer.