WordPress.org

Make WordPress Core

Changeset 14179


Ignore:
Timestamp:
04/21/2010 06:25:03 PM (8 years ago)
Author:
ryan
Message:

Clear the users cache when updating user metadata. fixes #13075

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/meta.php

    r13496 r14179  
    6060
    6161    wp_cache_delete($object_id, $meta_type . '_meta');
     62    // users cache stores usermeta that must be cleared.
     63    if ( 'user' == $meta_type )
     64        wp_cache_delete($object_id, 'users');
    6265
    6366    do_action( "added_{$meta_type}_meta", $wpdb->insert_id, $object_id, $meta_key, $meta_value );
     
    120123    $wpdb->update( $table, $data, $where );
    121124    wp_cache_delete($object_id, $meta_type . '_meta');
     125    // users cache stores usermeta that must be cleared.
     126    if ( 'user' == $meta_type )
     127        wp_cache_delete($object_id, 'users');
    122128
    123129    do_action( "updated_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $meta_value );
     
    182188
    183189    wp_cache_delete($object_id, $meta_type . '_meta');
     190    // users cache stores usermeta that must be cleared.
     191    if ( 'user' == $meta_type )
     192        wp_cache_delete($object_id, 'users');
    184193
    185194    do_action( "deleted_{$meta_type}_meta", $meta_ids, $object_id, $meta_key, $meta_value );
Note: See TracChangeset for help on using the changeset viewer.