Make WordPress Core


Ignore:
Timestamp:
05/25/2018 01:22:44 AM (6 years ago)
Author:
boonebgorges
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-term-query.php

    r43308 r43313  
    678678        $cache        = wp_cache_get( $cache_key, 'terms' );
    679679        if ( false !== $cache ) {
    680             if ( 'all' === $_fields ) {
     680            if ( 'all' === $_fields || 'all_with_object_id' === $_fields ) {
    681681                $cache = $this->populate_terms( $cache );
    682682            }
Note: See TracChangeset for help on using the changeset viewer.