Make WordPress Core

Changeset 19729


Ignore:
Timestamp:
01/11/2012 09:26:18 PM (12 years ago)
Author:
ryan
Message:

Use wp_cache_add() instead of wp_cache_set() when priming the object term cache in update_object_term_cache(). Pass the real post_type to clean_object_term_cache() instead of hard-coding post. Call clean_object_term_cache() from clean_bookmark_cache(). Props leewillis77. fixes #19690

Location:
trunk/wp-includes
Files:
3 edited

Legend:

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

    r19712 r19729  
    376376 * @uses wp_cache_delete() Deletes the contents of 'get_bookmarks'
    377377 */
    378 function clean_bookmark_cache($bookmark_id) {
     378function clean_bookmark_cache( $bookmark_id ) {
    379379    wp_cache_delete( $bookmark_id, 'bookmark' );
    380380    wp_cache_delete( 'get_bookmarks', 'bookmark' );
    381 }
     381    clean_object_term_cache( $bookmark_id, 'link');
     382}
  • trunk/wp-includes/post.php

    r19727 r19729  
    43314331        return;
    43324332
     4333    $post = get_post( $id );
     4334
    43334335    wp_cache_delete($id, 'posts');
    43344336    wp_cache_delete($id, 'post_meta');
    43354337
    4336     clean_object_term_cache($id, 'post');
     4338    clean_object_term_cache( $id, $post->post_type );
    43374339
    43384340    wp_cache_delete( 'wp_get_archives', 'general' );
  • trunk/wp-includes/taxonomy.php

    r19684 r19729  
    26582658
    26592659    foreach ( $ids as $id ) {
    2660         foreach ( $taxonomies  as $taxonomy ) {
     2660        foreach ( $taxonomies as $taxonomy ) {
    26612661            if ( ! isset($object_terms[$id][$taxonomy]) ) {
    26622662                if ( !isset($object_terms[$id]) )
     
    26692669    foreach ( $object_terms as $id => $value ) {
    26702670        foreach ( $value as $taxonomy => $terms ) {
    2671             wp_cache_set($id, $terms, "{$taxonomy}_relationships");
     2671            wp_cache_add( $id, $terms, "{$taxonomy}_relationships" );
    26722672        }
    26732673    }
Note: See TracChangeset for help on using the changeset viewer.