diff --git a/wp-includes/post.php b/wp-includes/post.php
index 98aeef5..8f9d55d 100644
a
|
b
|
function get_page_by_path( $page_path, $output = OBJECT, $post_type = 'page' ) { |
4245 | 4245 | |
4246 | 4246 | $post_types = esc_sql( $post_types ); |
4247 | 4247 | $post_type_in_string = "'" . implode( "','", $post_types ) . "'"; |
| 4248 | |
| 4249 | $key = $parts . ":" . $post_type_in_string; |
| 4250 | $last_changed = wp_cache_get( 'last_changed', 'posts' ); |
| 4251 | if ( ! $last_changed ) { |
| 4252 | $last_changed = microtime(); |
| 4253 | wp_cache_set( 'last_changed', $last_changed, 'posts' ); |
| 4254 | } |
| 4255 | $cache_key = "get_page_by_path:$key:$last_changed"; |
| 4256 | if ( $cache = wp_cache_get( $cache_key, 'posts' ) ) { |
| 4257 | return get_post( $cache, $output ); |
| 4258 | } |
| 4259 | |
4248 | 4260 | $sql = " |
4249 | 4261 | SELECT ID, post_name, post_parent, post_type |
4250 | 4262 | FROM $wpdb->posts |
… |
… |
function get_page_by_path( $page_path, $output = OBJECT, $post_type = 'page' ) { |
4281 | 4293 | } |
4282 | 4294 | } |
4283 | 4295 | } |
4284 | | |
| 4296 | wp_cache_set( $cache_key, $foundid, 'posts' ); |
4285 | 4297 | if ( $foundid ) { |
4286 | 4298 | return get_post( $foundid, $output ); |
4287 | 4299 | } |