Ticket #35381: term_id.patch
File term_id.patch, 945 bytes (added by , 8 years ago) |
---|
-
src/wp-includes/class-wp-term-query.php
634 634 $cache = wp_cache_get( $cache_key, 'terms' ); 635 635 if ( false !== $cache ) { 636 636 if ( 'all' === $_fields ) { 637 _prime_term_caches( $cache, $args['update_term_meta_cache'] ); 637 638 $cache = array_map( 'get_term', $cache ); 638 639 } 639 640 … … 732 733 } 733 734 } 734 735 735 wp_cache_add( $cache_key, $terms, 'terms', DAY_IN_SECONDS );736 737 736 if ( 'all' === $_fields ) { 738 $terms = array_map( 'get_term', $terms ); 737 $terms = array_map( 'get_term', $terms ); 738 $term_ids = wp_list_pluck( $terms, 'term_id' ); 739 wp_cache_add( $cache_key, $term_ids, 'terms', DAY_IN_SECONDS ); 740 } else { 741 wp_cache_add( $cache_key, $terms, 'terms', DAY_IN_SECONDS ); 739 742 } 740 743 741 744 $this->terms = $terms;