Ticket #15458: 15458-clean_user_cache.diff
File 15458-clean_user_cache.diff, 1.8 KB (added by , 13 years ago) |
---|
-
wp-includes/meta.php
73 73 $mid = (int) $wpdb->insert_id; 74 74 75 75 wp_cache_delete($object_id, $meta_type . '_meta'); 76 // users cache stores usermeta that must be cleared. 77 if ( 'user' == $meta_type ) 78 clean_user_cache( $object_id ); 76 79 77 80 do_action( "added_{$meta_type}_meta", $mid, $object_id, $meta_key, $_meta_value ); 78 81 … … 154 157 $wpdb->update( $table, $data, $where ); 155 158 156 159 wp_cache_delete($object_id, $meta_type . '_meta'); 160 // users cache stores usermeta that must be cleared. 161 if ( 'user' == $meta_type ) 162 clean_user_cache( $object_id ); 157 163 158 164 do_action( "updated_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value ); 159 165 … … 236 242 if ( $delete_all ) { 237 243 foreach ( (array) $object_ids as $o_id ) { 238 244 wp_cache_delete($o_id, $meta_type . '_meta'); 245 if ( 'user' == $meta_type ) 246 clean_user_cache( $o_id ); 239 247 } 240 248 } else { 241 249 wp_cache_delete($object_id, $meta_type . '_meta'); 250 if ( 'user' == $meta_type ) 251 clean_user_cache( $object_id ); 242 252 } 243 253 244 254 do_action( "deleted_{$meta_type}_meta", $meta_ids, $object_id, $meta_key, $_meta_value ); … … 437 447 438 448 // Clear the caches. 439 449 wp_cache_delete($object_id, $meta_type . '_meta'); 450 if ( 'user' == $meta_type ) 451 clean_user_cache( $object_id ); 440 452 441 453 do_action( "updated_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value ); 442 454 … … 493 505 494 506 // Clear the caches. 495 507 wp_cache_delete($object_id, $meta_type . '_meta'); 508 if ( 'user' == $meta_type ) 509 clean_user_cache( $object_id ); 496 510 497 511 do_action( "deleted_{$meta_type}_meta", (array) $meta_id, $object_id, $meta->meta_key, $meta->meta_value ); 498 512