Changeset 27142 for trunk/src/wp-includes/taxonomy.php
- Timestamp:
- 02/09/2014 05:41:07 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r27141 r27142 3517 3517 */ 3518 3518 function get_taxonomy_last_changed( $taxonomy ) { 3519 $last_changed = wp_cache_get( 'last_changed', $taxonomy ); 3519 $key = $taxonomy . '_last_changed'; 3520 $last_changed = wp_cache_get( $key, 'terms' ); 3520 3521 if ( ! $last_changed ) { 3521 3522 $last_changed = microtime(); 3522 wp_cache_set( 'last_changed', $last_changed, $taxonomy);3523 wp_cache_set( $key, $last_changed, 'terms' ); 3523 3524 } 3524 3525 return $last_changed; … … 3534 3535 */ 3535 3536 function set_taxonomy_last_changed( $taxonomy ) { 3536 wp_cache_delete( 'last_changed', $taxonomy);3537 wp_cache_delete( $taxonomy . '_last_changed', 'terms' ); 3537 3538 return get_taxonomy_last_changed( $taxonomy ); 3538 3539 } … … 3554 3555 function post_taxonomy_is_fresh( $id, $taxonomy ) { 3555 3556 $last_changed = get_taxonomy_last_changed( $taxonomy ); 3556 $post_last_changed = wp_cache_get( $id, $taxonomy . '_last_changed' ); 3557 $key = $id . '_' . $taxonomy . '_last_changed'; 3558 $post_last_changed = wp_cache_get( $key, 'terms' ); 3557 3559 if ( ! $post_last_changed || $last_changed !== $post_last_changed ) { 3558 wp_cache_set( $ id, $last_changed, $taxonomy . '_last_changed' );3560 wp_cache_set( $key, $last_changed, 'terms' ); 3559 3561 return false; 3560 3562 } … … 3578 3580 function taxonomy_hierarchy_is_fresh( $taxonomy ) { 3579 3581 $last_changed = get_taxonomy_last_changed( $taxonomy ); 3580 $hierarchy_last_changed = wp_cache_get( 'hierarchy_last_changed', $taxonomy ); 3582 $key = $taxonomy . '_hierarchy_last_changed'; 3583 $hierarchy_last_changed = wp_cache_get( $key, 'terms' ); 3581 3584 if ( ! $hierarchy_last_changed || $last_changed !== $hierarchy_last_changed ) { 3582 wp_cache_set( 'hierarchy_last_changed', $last_changed, $taxonomy);3585 wp_cache_set( $key, $last_changed, 'terms' ); 3583 3586 return false; 3584 3587 }
Note: See TracChangeset
for help on using the changeset viewer.