Changeset 38849
- Timestamp:
- 10/21/2016 02:53:19 AM (8 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-comment-query.php
r38768 r38849 394 394 // $args can include anything. Only use the args defined in the query_var_defaults to compute the key. 395 395 $key = md5( serialize( wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) ) ) ); 396 $last_changed = wp_cache_get( 'last_changed', 'comment' ); 397 if ( ! $last_changed ) { 398 $last_changed = microtime(); 399 wp_cache_set( 'last_changed', $last_changed, 'comment' ); 400 } 396 $last_changed = wp_cache_get_last_changed( 'comment' ); 397 401 398 402 399 $cache_key = "get_comments:$key:$last_changed"; … … 973 970 974 971 $key = md5( serialize( wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) ) ) ); 975 $last_changed = wp_cache_get( 'last_changed', 'comment' ); 976 if ( ! $last_changed ) { 977 $last_changed = microtime(); 978 wp_cache_set( 'last_changed', $last_changed, 'comment' ); 979 } 972 $last_changed = wp_cache_get_last_changed( 'comment' ); 980 973 981 974 // Fetch an entire level of the descendant tree at a time. -
trunk/src/wp-includes/class-wp-network-query.php
r38768 r38849 210 210 // $args can include anything. Only use the args defined in the query_var_defaults to compute the key. 211 211 $key = md5( serialize( wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) ) ) ); 212 $last_changed = wp_cache_get( 'last_changed', 'networks' ); 213 if ( ! $last_changed ) { 214 $last_changed = microtime(); 215 wp_cache_set( 'last_changed', $last_changed, 'networks' ); 216 } 212 $last_changed = wp_cache_get_last_changed( 'networks' ); 217 213 218 214 $cache_key = "get_network_ids:$key:$last_changed"; -
trunk/src/wp-includes/class-wp-site-query.php
r38768 r38849 246 246 // $args can include anything. Only use the args defined in the query_var_defaults to compute the key. 247 247 $key = md5( serialize( wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) ) ) ); 248 $last_changed = wp_cache_get( 'last_changed', 'sites' ); 249 if ( ! $last_changed ) { 250 $last_changed = microtime(); 251 wp_cache_set( 'last_changed', $last_changed, 'sites' ); 252 } 248 $last_changed = wp_cache_get_last_changed( 'sites' ); 253 249 254 250 $cache_key = "get_sites:$key:$last_changed"; -
trunk/src/wp-includes/class-wp-term-query.php
r38784 r38849 674 674 // $args can be anything. Only use the args defined in defaults to compute the key. 675 675 $key = md5( serialize( wp_array_slice_assoc( $args, array_keys( $this->query_var_defaults ) ) ) . serialize( $taxonomies ) . $this->request ); 676 $last_changed = wp_cache_get( 'last_changed', 'terms' ); 677 if ( ! $last_changed ) { 678 $last_changed = microtime(); 679 wp_cache_set( 'last_changed', $last_changed, 'terms' ); 680 } 676 $last_changed = wp_cache_get_last_changed( 'terms' ); 681 677 $cache_key = "get_terms:$key:$last_changed"; 682 678 $cache = wp_cache_get( $cache_key, 'terms' ); -
trunk/src/wp-includes/functions.php
r38832 r38849 5554 5554 ); 5555 5555 } 5556 5557 /** 5558 * Get last changed date for the specified cache group. 5559 * 5560 * @since 4.7.0 5561 * 5562 * @param $group Where the cache contents are grouped. 5563 * 5564 * @return string $last_changed UNIX timestamp with microseconds representing when the group was last changed. 5565 */ 5566 function wp_cache_get_last_changed( $group ) { 5567 $last_changed = wp_cache_get( 'last_changed', $group ); 5568 5569 if ( ! $last_changed ) { 5570 $last_changed = microtime(); 5571 wp_cache_set( 'last_changed', $last_changed, $group ); 5572 } 5573 5574 return $last_changed; 5575 } -
trunk/src/wp-includes/general-template.php
r38826 r38849 1714 1714 $output = ''; 1715 1715 1716 $last_changed = wp_cache_get( 'last_changed', 'posts' ); 1717 if ( ! $last_changed ) { 1718 $last_changed = microtime(); 1719 wp_cache_set( 'last_changed', $last_changed, 'posts' ); 1720 } 1716 $last_changed = wp_cache_get_last_changed( 'posts' ); 1721 1717 1722 1718 $limit = $r['limit']; -
trunk/src/wp-includes/post.php
r38832 r38849 4195 4195 global $wpdb; 4196 4196 4197 $last_changed = wp_cache_get( 'last_changed', 'posts' ); 4198 if ( false === $last_changed ) { 4199 $last_changed = microtime(); 4200 wp_cache_set( 'last_changed', $last_changed, 'posts' ); 4201 } 4197 $last_changed = wp_cache_get_last_changed( 'posts' ); 4202 4198 4203 4199 $hash = md5( $page_path . serialize( $post_type ) ); … … 4541 4537 // $args can be whatever, only use the args defined in defaults to compute the key. 4542 4538 $key = md5( serialize( wp_array_slice_assoc( $r, array_keys( $defaults ) ) ) ); 4543 $last_changed = wp_cache_get( 'last_changed', 'posts' ); 4544 if ( ! $last_changed ) { 4545 $last_changed = microtime(); 4546 wp_cache_set( 'last_changed', $last_changed, 'posts' ); 4547 } 4539 $last_changed = wp_cache_get_last_changed( 'posts' ); 4548 4540 4549 4541 $cache_key = "get_pages:$key:$last_changed";
Note: See TracChangeset
for help on using the changeset viewer.