Make WordPress Core


Ignore:
Timestamp:
08/03/2012 01:06:05 AM (12 years ago)
Author:
nacin
Message:

Move most instances of new WP_User to get_userdata(). see #21120.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/ms.php

    r21387 r21413  
    690690    $super_admins = get_site_option( 'site_admins', array( 'admin' ) );
    691691
    692     $user = new WP_User( $user_id );
    693     if ( ! in_array( $user->user_login, $super_admins ) ) {
     692    $user = get_userdata( $user_id );
     693    if ( $user && ! in_array( $user->user_login, $super_admins ) ) {
    694694        $super_admins[] = $user->user_login;
    695695        update_site_option( 'site_admins' , $super_admins );
     
    718718    $super_admins = get_site_option( 'site_admins', array( 'admin' ) );
    719719
    720     $user = new WP_User( $user_id );
    721     if ( $user->user_email != get_site_option( 'admin_email' ) ) {
     720    $user = get_userdata( $user_id );
     721    if ( $user && $user->user_email != get_site_option( 'admin_email' ) ) {
    722722        if ( false !== ( $key = array_search( $user->user_login, $super_admins ) ) ) {
    723723            unset( $super_admins[$key] );
Note: See TracChangeset for help on using the changeset viewer.