Make WordPress Core


Ignore:
Timestamp:
02/03/2022 05:41:46 PM (22 months ago)
Author:
spacedmonkey
Message:

Taxonomy: Remove cache expiry limitation in WP_Term_Query.

Remove the one day expiry limitation from query caches found in the WP_Term_Qurery class. Removing this limitation means that the caches will remain in object caching, as long as possible. Ensure that all term / taxonomy cache clear functions invalidate query caches, by deleting the last_changed value in the terms cache group.

Props spacedmonkey, adamsilverstein, boonebgorges, tillkruess, dlh, flixos90.
Fixes #54511.

File:
1 edited

Legend:

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

    r52553 r52669  
    35193519    }
    35203520
     3521    wp_cache_delete( 'last_changed', 'terms' );
     3522
    35213523    /**
    35223524     * Fires after the object term cache has been cleaned.
     
    36113613    wp_cache_delete( 'all_ids', $taxonomy );
    36123614    wp_cache_delete( 'get', $taxonomy );
     3615    wp_cache_delete( 'last_changed', 'terms' );
    36133616
    36143617    // Regenerate cached hierarchy.
Note: See TracChangeset for help on using the changeset viewer.