mirror of
git://develop.git.wordpress.org/
synced 2025-01-19 13:47:02 +01:00
Make sure user_login keyed caches are cleared upon change.
git-svn-id: https://develop.svn.wordpress.org/trunk@3254 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
90c78120d7
commit
b6a751dc30
@ -210,6 +210,7 @@ function wp_delete_user($id, $reassign = 'novalue') {
|
||||
global $wpdb;
|
||||
|
||||
$id = (int) $id;
|
||||
$user = get_userdata($id);
|
||||
|
||||
if ($reassign == 'novalue') {
|
||||
$post_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_author = $id");
|
||||
@ -239,7 +240,7 @@ function wp_delete_user($id, $reassign = 'novalue') {
|
||||
$wpdb->query("DELETE FROM $wpdb->users WHERE ID = $id");
|
||||
|
||||
wp_cache_delete($id, 'users');
|
||||
// TODO: Need to delete username keyed cache object.
|
||||
wp_cache_delete($user->user_login, 'users');
|
||||
|
||||
do_action('delete_user', $id);
|
||||
|
||||
|
@ -2138,13 +2138,17 @@ function update_usermeta( $user_id, $meta_key, $meta_value ) {
|
||||
$wpdb->query("INSERT INTO $wpdb->usermeta ( user_id, meta_key, meta_value )
|
||||
VALUES
|
||||
( '$user_id', '$meta_key', '$meta_value' )");
|
||||
return true;
|
||||
}
|
||||
if ( $cur->meta_value != $meta_value )
|
||||
} else if ( $cur->meta_value != $meta_value ) {
|
||||
$wpdb->query("UPDATE $wpdb->usermeta SET meta_value = '$meta_value' WHERE user_id = '$user_id' AND meta_key = '$meta_key'");
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
$user = get_userdata($user_id);
|
||||
wp_cache_delete($user_id, 'users');
|
||||
// FIXME: Need to delete username keyed cache object.
|
||||
wp_cache_delete($user->user_login, 'users');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function delete_usermeta( $user_id, $meta_key, $meta_value = '' ) {
|
||||
@ -2162,8 +2166,11 @@ function delete_usermeta( $user_id, $meta_key, $meta_value = '' ) {
|
||||
else
|
||||
$wpdb->query("DELETE FROM $wpdb->usermeta WHERE user_id = '$user_id' AND meta_key = '$meta_key'");
|
||||
|
||||
$user = get_userdata($user_id);
|
||||
wp_cache_delete($user_id, 'users');
|
||||
// FIXME: Need to delete username keyed cache object.
|
||||
wp_cache_delete($user->user_login, 'users');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function register_activation_hook($file, $function) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user