mirror of
git://develop.git.wordpress.org/
synced 2025-02-27 18:13:00 +01:00
Clear the users cache when updating user metadata. fixes #13075
git-svn-id: https://develop.svn.wordpress.org/trunk@14179 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
20dcabfd49
commit
6973ce2f9f
@ -59,6 +59,9 @@ function add_metadata($meta_type, $object_id, $meta_key, $meta_value, $unique =
|
||||
) );
|
||||
|
||||
wp_cache_delete($object_id, $meta_type . '_meta');
|
||||
// users cache stores usermeta that must be cleared.
|
||||
if ( 'user' == $meta_type )
|
||||
wp_cache_delete($object_id, 'users');
|
||||
|
||||
do_action( "added_{$meta_type}_meta", $wpdb->insert_id, $object_id, $meta_key, $meta_value );
|
||||
|
||||
@ -119,6 +122,9 @@ function update_metadata($meta_type, $object_id, $meta_key, $meta_value, $prev_v
|
||||
|
||||
$wpdb->update( $table, $data, $where );
|
||||
wp_cache_delete($object_id, $meta_type . '_meta');
|
||||
// users cache stores usermeta that must be cleared.
|
||||
if ( 'user' == $meta_type )
|
||||
wp_cache_delete($object_id, 'users');
|
||||
|
||||
do_action( "updated_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $meta_value );
|
||||
|
||||
@ -181,6 +187,9 @@ function delete_metadata($meta_type, $object_id, $meta_key, $meta_value = '', $d
|
||||
return false;
|
||||
|
||||
wp_cache_delete($object_id, $meta_type . '_meta');
|
||||
// users cache stores usermeta that must be cleared.
|
||||
if ( 'user' == $meta_type )
|
||||
wp_cache_delete($object_id, 'users');
|
||||
|
||||
do_action( "deleted_{$meta_type}_meta", $meta_ids, $object_id, $meta_key, $meta_value );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user