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/network/users.php

    r21003 r21413  
    3535    foreach ( ( $allusers = (array) $_POST['allusers'] ) as $key => $val ) {
    3636        if ( $val != '' && $val != '0' ) {
    37             $delete_user = new WP_User( $val );
     37            $delete_user = get_userdata( $val );
    3838
    3939            if ( ! current_user_can( 'delete_user', $delete_user->ID ) )
     
    140140
    141141                            case 'spam':
    142                                 $user = new WP_User( $val );
    143                                 if ( in_array( $user->user_login, get_super_admins() ) )
     142                                $user = get_userdata( $val );
     143                                if ( is_super_admin( $user->ID ) )
    144144                                    wp_die( sprintf( __( 'Warning! User cannot be modified. The user %s is a network administrator.' ), esc_html( $user->user_login ) ) );
    145145
Note: See TracChangeset for help on using the changeset viewer.