Ticket #21760: 21760.11.diff
File 21760.11.diff, 2.2 KB (added by , 9 years ago) |
---|
-
src/wp-includes/functions.php
4629 4629 4630 4630 return (bool) $var; 4631 4631 } 4632 4633 /**4634 * Helper function to retrieve an incrementer identified by $group4635 *4636 * @since 4.1.04637 *4638 * @param string $group The cache group for the incrementer.4639 * @param bool $force Whether or not to generate a new incrementor.4640 * @return int The timestamp representing 'last_changed'.4641 */4642 function wp_get_last_changed( $group, $force = false ) {4643 $last_changed = wp_cache_get( 'last_changed', $group );4644 if ( ! $last_changed || true === $force ) {4645 $last_changed = microtime();4646 wp_cache_set( 'last_changed', $last_changed, $group );4647 }4648 return $last_changed;4649 }4650 No newline at end of file -
src/wp-includes/taxonomy.php
1291 1291 return $error; 1292 1292 } 1293 1293 1294 $group = $taxonomy . ':' . wp_ get_last_changed('terms' );1294 $group = $taxonomy . ':' . wp_cache_get( 'last_changed', 'terms' ); 1295 1295 if ( is_object($term) && empty($term->filter) ) { 1296 1296 wp_cache_add( $term->term_id, $term, $taxonomy ); 1297 1297 wp_cache_add( "slug:{$term->slug}", $term->term_id, $group ); … … 1381 1381 return false; 1382 1382 1383 1383 $cache = false; 1384 $group = $taxonomy . ':' . wp_ get_last_changed('terms' );1384 $group = $taxonomy . ':' . wp_cache_get( 'last_changed', 'terms' ); 1385 1385 if ( 'slug' == $field ) { 1386 1386 $field = 't.slug'; 1387 1387 $value = sanitize_title($value); … … 3657 3657 do_action( 'clean_term_cache', $ids, $taxonomy ); 3658 3658 } 3659 3659 3660 wp_ get_last_changed( 'terms', true);3660 wp_cache_set( 'last_changed', microtime(), 'terms' ); 3661 3661 } 3662 3662 3663 3663 /** … … 3764 3764 $term_taxonomy = $term->taxonomy; 3765 3765 3766 3766 wp_cache_add( $term->term_id, $term, $term_taxonomy ); 3767 $group = $term_taxonomy . ':' . wp_ get_last_changed( 'terms', true);3767 $group = $term_taxonomy . ':' . wp_cache_set( 'last_changed', microtime(), 'terms' ); 3768 3768 wp_cache_add( "slug:{$term->slug}", $term->term_id, $group ); 3769 3769 wp_cache_add( "name:" . md5( $term->name ), $term->term_id, $group ); 3770 3770 }