Clear the users cache when updating user metadata. fixes #13075
git-svn-id: http://svn.automattic.com/wordpress/trunk@14179 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
73f0e2f334
commit
41a9873022
|
@ -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…
Reference in New Issue