Make WordPress Core


Ignore:
Timestamp:
03/30/2017 04:55:32 PM (7 years ago)
Author:
boonebgorges
Message:

Invalidate term query caches when setting or deleting term relationships.

Prior to 4.7, term relationships - as set by wp_set_object_terms() or
wp_remove_object_terms() - did not affect the term query cache. The
introduction of the 'object_ids' parameter in 4.7 means that the query
cache must be aware of object-term relationships. As such, the
'last_changed' incrementor is now invalidated when term relationships
are modified.

This bug only reared its head when delaying term counting, because term
counting performs its own term query cache invalidation.

Merges [40353] to the 4.7 branch.

Props mboynes.
Fixes #40306.

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/src/wp-includes/taxonomy.php

    r40291 r40354  
    23132313
    23142314    wp_cache_delete( $object_id, $taxonomy . '_relationships' );
     2315    wp_cache_delete( 'last_changed', 'terms' );
    23152316
    23162317    /**
     
    24072408
    24082409        wp_cache_delete( $object_id, $taxonomy . '_relationships' );
     2410        wp_cache_delete( 'last_changed', 'terms' );
    24092411
    24102412        /**
Note: See TracChangeset for help on using the changeset viewer.