Make WordPress Core


Ignore:
Timestamp:
01/19/2010 07:23:11 PM (15 years ago)
Author:
ryan
Message:

Introduce clean_user_cache(). fixes #11761

File:
1 edited

Legend:

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

    r12755 r12766  
    420420 * @return bool True when finished.
    421421 */
    422 function wp_delete_user($id, $reassign = 'novalue') {
     422function wp_delete_user( $id, $reassign = 'novalue' ) {
    423423    global $wpdb;
    424424
     
    429429    do_action('delete_user', $id);
    430430
    431     if ($reassign == 'novalue') {
     431    if ( 'novalue' === $reassign || null === $reassign ) {
    432432        $post_ids = $wpdb->get_col( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_author = %d", $id) );
    433433
    434         if ($post_ids) {
    435             foreach ($post_ids as $post_id)
     434        if ( $post_ids ) {
     435            foreach ( $post_ids as $post_id )
    436436                wp_delete_post($post_id);
    437437        }
     
    444444                wp_delete_link($link_id);
    445445        }
    446 
    447446    } else {
    448447        $reassign = (int) $reassign;
     
    460459    }
    461460
    462     wp_cache_delete($id, 'users');
    463     wp_cache_delete($user->user_login, 'userlogins');
    464     wp_cache_delete($user->user_email, 'useremail');
    465     wp_cache_delete($user->user_nicename, 'userslugs');
     461    clean_user_cache($id);
    466462
    467463    // allow for commit transaction
Note: See TracChangeset for help on using the changeset viewer.