mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@52669 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -775,7 +775,7 @@ class WP_Term_Query {
|
||||
}
|
||||
|
||||
if ( empty( $terms ) ) {
|
||||
wp_cache_add( $cache_key, array(), 'terms', DAY_IN_SECONDS );
|
||||
wp_cache_add( $cache_key, array(), 'terms' );
|
||||
return array();
|
||||
}
|
||||
|
||||
@@ -880,7 +880,7 @@ class WP_Term_Query {
|
||||
}
|
||||
}
|
||||
|
||||
wp_cache_add( $cache_key, $terms, 'terms', DAY_IN_SECONDS );
|
||||
wp_cache_add( $cache_key, $terms, 'terms' );
|
||||
|
||||
if ( 'all' === $_fields || 'all_with_object_id' === $_fields ) {
|
||||
$terms = $this->populate_terms( $terms );
|
||||
|
||||
Reference in New Issue
Block a user