WordPress.org

Make WordPress Core

Changeset 3254


Ignore:
Timestamp:
12/01/2005 05:38:37 PM (16 years ago)
Author:
ryan
Message:

Make sure user_login keyed caches are cleared upon change.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-db.php

    r3175 r3254  
    211211
    212212    $id = (int) $id;
     213    $user = get_userdata($id);
    213214
    214215    if ($reassign == 'novalue') {
     
    240241
    241242    wp_cache_delete($id, 'users');
    242     // TODO: Need to delete username keyed cache object.
     243    wp_cache_delete($user->user_login, 'users');
    243244
    244245    do_action('delete_user', $id);
  • trunk/wp-includes/functions.php

    r3247 r3254  
    21392139        VALUES
    21402140        ( '$user_id', '$meta_key', '$meta_value' )");
    2141         return true;
    2142     }
    2143     if ( $cur->meta_value != $meta_value )
     2141    } else if ( $cur->meta_value != $meta_value ) {
    21442142        $wpdb->query("UPDATE $wpdb->usermeta SET meta_value = '$meta_value' WHERE user_id = '$user_id' AND meta_key = '$meta_key'");
    2145 
     2143    } else {
     2144        return false;   
     2145    }
     2146   
     2147    $user = get_userdata($user_id);
    21462148    wp_cache_delete($user_id, 'users');
    2147     // FIXME: Need to delete username keyed cache object.
     2149    wp_cache_delete($user->user_login, 'users');
     2150   
     2151    return true;
    21482152}
    21492153
     
    21632167        $wpdb->query("DELETE FROM $wpdb->usermeta WHERE user_id = '$user_id' AND meta_key = '$meta_key'");
    21642168       
     2169    $user = get_userdata($user_id);
    21652170    wp_cache_delete($user_id, 'users');
    2166     // FIXME: Need to delete username keyed cache object.
     2171    wp_cache_delete($user->user_login, 'users');
     2172   
     2173    return true;
    21672174}
    21682175
Note: See TracChangeset for help on using the changeset viewer.