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

    r21003 r21413  
    112112            wp_die(__('Cheatin’ uh?'));
    113113
    114         $user = new WP_User($id);
     114        $user = get_userdata( $id );
    115115        $user->set_role($_REQUEST['new_role']);
    116116    }
     
    202202    foreach ( $userids as $id ) {
    203203        $id = (int) $id;
    204         $user = new WP_User($id);
     204        $user = get_userdata( $id );
    205205        if ( $id == $current_user->ID ) {
    206206            echo "<li>" . sprintf(__('ID #%1s: %2s <strong>The current user will not be deleted.</strong>'), $id, $user->user_login) . "</li>\n";
     
    303303    foreach ( $userids as $id ) {
    304304        $id = (int) $id;
    305         $user = new WP_User($id);
     305        $user = get_userdata( $id );
    306306        if ( $id == $current_user->ID && !is_super_admin() ) {
    307307            echo "<li>" . sprintf(__('ID #%1s: %2s <strong>The current user will not be removed.</strong>'), $id, $user->user_login) . "</li>\n";
Note: See TracChangeset for help on using the changeset viewer.