Ticket #23326: 23326.diff
| File 23326.diff, 1.3 KB (added by ryan, 4 months ago) |
|---|
-
wp-includes/taxonomy.php
1240 1240 // $args can be whatever, only use the args defined in defaults to compute the key 1241 1241 $filter_key = ( has_filter('list_terms_exclusions') ) ? serialize($GLOBALS['wp_filter']['list_terms_exclusions']) : ''; 1242 1242 $key = md5( serialize( compact(array_keys($defaults)) ) . serialize( $taxonomies ) . $filter_key ); 1243 $last_changed = wp_cache_get( 'last_changed', 'terms');1244 if ( ! $last_changed ) {1245 $last_changed = time();1246 wp_cache_set( 'last_changed', $last_changed, 'terms');1243 $last_changed = wp_cache_get( 'last_changed', 'terms' ); 1244 if ( ! $last_changed ) { 1245 $last_changed = 1; 1246 wp_cache_set( 'last_changed', $last_changed, 'terms' ); 1247 1247 } 1248 1248 $cache_key = "get_terms:$key:$last_changed"; 1249 1249 $cache = wp_cache_get( $cache_key, 'terms' ); … … 2632 2632 do_action('clean_term_cache', $ids, $taxonomy); 2633 2633 } 2634 2634 2635 wp_cache_set('last_changed', time(), 'terms'); 2635 if ( function_exists( 'wp_cache_incr' ) ) { 2636 wp_cache_incr( 'last_changed', 1, 'terms' ); 2637 } else { 2638 $last_changed = wp_cache_get( 'last_changed', 'terms' ); 2639 wp_cache_set( 'last_changed', $last_changed + 1, 'terms' ); 2640 } 2636 2641 } 2637 2642 2638 2643 /**
