mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
Taxonomy: Improve cache handling when querying for terms using all_with_object_id.
When a term query using `fields=all_with_object_id` hits the cache, the cached `stdClass` objects must be converted to `WP_Term` objects. This was overlooked when `WP_Term_Query` was refactored to support object queries in [38667]. Props dlh. Fixes #44221. git-svn-id: https://develop.svn.wordpress.org/trunk@43313 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -677,7 +677,7 @@ class WP_Term_Query {
|
||||
$cache_key = "get_terms:$key:$last_changed";
|
||||
$cache = wp_cache_get( $cache_key, 'terms' );
|
||||
if ( false !== $cache ) {
|
||||
if ( 'all' === $_fields ) {
|
||||
if ( 'all' === $_fields || 'all_with_object_id' === $_fields ) {
|
||||
$cache = $this->populate_terms( $cache );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user