Make WordPress Core


Ignore:
Timestamp:
10/13/2015 02:57:21 AM (9 years ago)
Author:
boonebgorges
Message:

In get_terms(), don't store WP_Term objects in cache.

Fixes #34282.

File:
1 edited

Legend:

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

    r35032 r35117  
    11561156    $cache = wp_cache_get( $cache_key, 'terms' );
    11571157    if ( false !== $cache ) {
     1158        if ( 'all' === $args['fields'] ) {
     1159            $cache = array_map( 'get_term', $cache );
     1160        }
    11581161
    11591162        /**
     
    14951498            $_terms[ $term->term_id ] = $term->slug;
    14961499        }
    1497     } else {
    1498         $_terms = array_map( 'get_term', $terms );
    14991500    }
    15001501
     
    15081509
    15091510    wp_cache_add( $cache_key, $terms, 'terms', DAY_IN_SECONDS );
     1511
     1512    if ( 'all' === $_fields ) {
     1513        $terms = array_map( 'get_term', $terms );
     1514    }
    15101515
    15111516    /** This filter is documented in wp-includes/taxonomy */
Note: See TracChangeset for help on using the changeset viewer.