Changeset 37479 for trunk/src/wp-includes/post.php
- Timestamp:
- 05/21/2016 05:26:55 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post.php
r37403 r37479 4232 4232 global $wpdb; 4233 4233 4234 $last_changed = wp_cache_get( 'last_changed', 'posts' ); 4235 if ( false === $last_changed ) { 4236 $last_changed = microtime(); 4237 wp_cache_set( 'last_changed', $last_changed, 'posts' ); 4238 } 4239 4240 $hash = md5( $page_path . serialize( $post_type ) ); 4241 $cache_key = "get_page_by_path:$hash:$last_changed"; 4242 $cached = wp_cache_get( $cache_key, 'posts' ); 4243 if ( false !== $cached ) { 4244 // Special case: '0' is a bad `$page_path`. 4245 if ( '0' === $cached || 0 === $cached ) { 4246 return; 4247 } else { 4248 return get_post( $cached ); 4249 } 4250 } 4251 4234 4252 $page_path = rawurlencode(urldecode($page_path)); 4235 4253 $page_path = str_replace('%2F', '/', $page_path); … … 4285 4303 } 4286 4304 } 4305 4306 // We cache misses as well as hits. 4307 wp_cache_set( $cache_key, $foundid, 'posts' ); 4287 4308 4288 4309 if ( $foundid ) {
Note: See TracChangeset
for help on using the changeset viewer.