Correct cache invalidation in update_usermeta() and delete_usermeta(). Props mdawaffe. Fixes #15559
git-svn-id: https://develop.svn.wordpress.org/trunk@16562 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
2cc12c224e
commit
a221abd2ac
@ -2296,7 +2296,8 @@ function delete_usermeta( $user_id, $meta_key, $meta_value = '' ) {
|
||||
else
|
||||
$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) );
|
||||
|
||||
wp_cache_delete($user_id, 'users');
|
||||
clean_user_cache( $user_id );
|
||||
wp_cache_delete( $user_id, 'user_meta' );
|
||||
|
||||
if ( $cur && $cur->umeta_id )
|
||||
do_action( 'deleted_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
|
||||
@ -2403,7 +2404,8 @@ function update_usermeta( $user_id, $meta_key, $meta_value ) {
|
||||
else
|
||||
return false;
|
||||
|
||||
wp_cache_delete($user_id, 'users');
|
||||
clean_user_cache( $user_id );
|
||||
wp_cache_delete( $user_id, 'user_meta' );
|
||||
|
||||
if ( !$cur )
|
||||
do_action( 'added_usermeta', $wpdb->insert_id, $user_id, $meta_key, $meta_value );
|
||||
|
Loading…
Reference in New Issue
Block a user