mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-01 05:57:55 +01: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]. Merges [43313] to the 4.9 branch. Props dlh. Fixes #44221. Built from https://develop.svn.wordpress.org/branches/4.9@43314 git-svn-id: http://core.svn.wordpress.org/branches/4.9@43143 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5129da3af5
commit
30b40c8f52
@ -671,7 +671,7 @@ class WP_Term_Query {
|
|||||||
$cache_key = "get_terms:$key:$last_changed";
|
$cache_key = "get_terms:$key:$last_changed";
|
||||||
$cache = wp_cache_get( $cache_key, 'terms' );
|
$cache = wp_cache_get( $cache_key, 'terms' );
|
||||||
if ( false !== $cache ) {
|
if ( false !== $cache ) {
|
||||||
if ( 'all' === $_fields ) {
|
if ( 'all' === $_fields || 'all_with_object_id' === $_fields ) {
|
||||||
$cache = array_map( 'get_term', $cache );
|
$cache = array_map( 'get_term', $cache );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.9.7-alpha-43306';
|
$wp_version = '4.9.7-alpha-43314';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user