WordPress.org

Make WordPress Core

Changeset 22878


Ignore:
Timestamp:
11/27/12 19:42:38 (17 months ago)
Author:
ryan
Message:

Clear the object term relationships cache in wp_set_object_terms() rather than wp_set_post_terms(). This should be done lower in the stack than wp_set_post_terms().

Props batmoo
fixes #22560

Location:
trunk/wp-includes
Files:
2 edited

Legend:

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

    r22743 r22878  
    31973197    } 
    31983198 
    3199     $r = wp_set_object_terms( $post_id, $tags, $taxonomy, $append ); 
    3200     if ( is_wp_error( $r ) ) 
    3201         return $r; 
    3202  
    3203     wp_cache_delete( $post_id, $taxonomy . '_relationships' ); 
    3204  
    3205     return $r; 
     3199    return wp_set_object_terms( $post_id, $tags, $taxonomy, $append ); 
    32063200} 
    32073201 
  • trunk/wp-includes/taxonomy.php

    r22634 r22878  
    22392239    } 
    22402240 
     2241    wp_cache_delete( $object_id, $taxonomy . '_relationships' ); 
     2242 
    22412243    do_action('set_object_terms', $object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids); 
    22422244    return $tt_ids; 
Note: See TracChangeset for help on using the changeset viewer.