Make WordPress Core


Ignore:
Timestamp:
04/18/2012 09:07:31 PM (12 years ago)
Author:
duck_
Message:

Pass full user objects to clean_user_cache(). See #19500, fixes #20460.

Prevents notices when clean_user_cache() is called for a user that has been removed from the database.

File:
1 edited

Legend:

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

    r20289 r20522  
    133133
    134134    $id = (int) $id;
     135    $user = new WP_User( $id );
    135136
    136137    do_action( 'wpmu_delete_user', $id );
     
    163164    $wpdb->delete( $wpdb->usermeta, array( 'user_id' => $id ) );
    164165
    165     clean_user_cache( $id );
     166    clean_user_cache( $user );
    166167
    167168    // allow for commit transaction
     
    390391    $wpdb->update( $wpdb->users, array( $pref => $value ), array( 'ID' => $id ) );
    391392
    392     clean_user_cache( $id );
     393    $user = new WP_User( $id );
     394    clean_user_cache( $user );
    393395
    394396    if ( $pref == 'spam' ) {
     
    408410        return false;
    409411
    410     clean_user_cache( $id );
     412    clean_user_cache( $user );
    411413
    412414    return $id;
Note: See TracChangeset for help on using the changeset viewer.