WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/30/2017 04:49:47 PM (5 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.

Props mboynes.
Fixes #40306.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/taxonomy.php

    r40298 r40353  
    22832283
    22842284    wp_cache_delete( $object_id, $taxonomy . '_relationships' );
     2285    wp_cache_delete( 'last_changed', 'terms' );
    22852286
    22862287    /**
     
    23772378
    23782379        wp_cache_delete( $object_id, $taxonomy . '_relationships' );
     2380        wp_cache_delete( 'last_changed', 'terms' );
    23792381
    23802382        /**
Note: See TracChangeset for help on using the changeset viewer.