Make WordPress Core

Changeset 45715


Ignore:
Timestamp:
08/01/2019 05:48:31 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Users: Use clean_user_cache() in wp_insert_user(), wp_update_user(), wp_set_password(), add_user_to_blog().

Props spacedmonkey.
Fixes #47021.

Location:
trunk/src/wp-includes
Files:
3 edited

Legend:

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

    r45590 r45715  
    207207     */
    208208    do_action( 'add_user_to_blog', $user_id, $role, $blog_id );
    209     wp_cache_delete( $user_id, 'users' );
     209
     210    clean_user_cache( $user_id );
    210211    wp_cache_delete( $blog_id . '_user_count', 'blog-details' );
     212
    211213    restore_current_blog();
     214
    212215    return true;
    213216}
  • trunk/src/wp-includes/pluggable.php

    r45712 r45715  
    25072507        );
    25082508
    2509         wp_cache_delete( $user_id, 'users' );
     2509        clean_user_cache( $user_id );
    25102510    }
    25112511endif;
  • trunk/src/wp-includes/user.php

    r45714 r45715  
    18541854        $user->set_role( get_option( 'default_role' ) );
    18551855    }
    1856     wp_cache_delete( $user_id, 'users' );
    1857     wp_cache_delete( $user_login, 'userlogins' );
     1856
     1857    clean_user_cache( $user_id );
    18581858
    18591859    if ( $update ) {
     
    19811981    }
    19821982
    1983     wp_cache_delete( $user['user_email'], 'useremail' );
    1984     wp_cache_delete( $user['user_nicename'], 'userslugs' );
     1983    clean_user_cache( $user_obj );
    19851984
    19861985    // Merge old and new fields with new fields overwriting old ones.
Note: See TracChangeset for help on using the changeset viewer.