Ticket #37189: 37189.diff
File 37189.diff, 1.4 KB (added by , 8 years ago) |
---|
-
src/wp-admin/includes/upgrade.php
1701 1701 */ 1702 1702 function upgrade_460() { 1703 1703 delete_post_meta_by_key( '_post_restored_from' ); 1704 wp_cache_set( 'last_changed', microtime(), 'terms' ); 1704 1705 } 1705 1706 1706 1707 /** -
src/wp-includes/class-wp-term-query.php
633 633 $cache_key = "get_terms:$key:$last_changed"; 634 634 $cache = wp_cache_get( $cache_key, 'terms' ); 635 635 if ( false !== $cache ) { 636 if ( 'all' === $_fields ) { 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 736 737 737 if ( 'all' === $_fields ) { 738 738 $terms = array_map( 'get_term', $terms ); 739 739 } 740 740 741 if ( 'all' === $_fields ) { 742 $terms = array_map( 'get_term', $terms ); 743 $term_ids = wp_list_pluck( $terms, 'term_id' ); 744 wp_cache_add( $cache_key, $term_ids, 'terms', DAY_IN_SECONDS ); 745 } else { 746 wp_cache_add( $cache_key, $terms, 'terms', DAY_IN_SECONDS ); 747 } 748 741 749 $this->terms = $terms; 742 750 return $this->terms; 743 751 }