Ticket #10381: post.php.diff
File post.php.diff, 1.0 KB (added by , 15 years ago) |
---|
-
wp-includes/post.php
366 366 } elseif ( is_object($post) && empty($post->filter) ) { 367 367 _get_post_ancestors($post); 368 368 $_post = sanitize_post($post, 'raw'); 369 if ( $cached_post = wp_cache_get($_post->ID, 'posts') ) { 370 if ( ! isset($cached_post->ancestors) ) 371 wp_cache_delete($_post->ID, 'posts'); 372 } 369 373 wp_cache_add($post->ID, $_post, 'posts'); 370 374 } else { 371 375 if ( is_object($post) ) … … 374 378 $post_id = $post; 375 379 376 380 $post_id = (int) $post_id; 377 if ( ! $_post = wp_cache_get($post_id, 'posts') ) { 381 382 if ( $_post = wp_cache_get($post_id, 'posts') ) { 383 if ( ! isset($_post->ancestors) ) { 384 _get_post_ancestors($_post); 385 wp_cache_set($_post->ID, $_post, 'posts'); 386 } 387 } elseif { 378 388 $_post = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->posts WHERE ID = %d LIMIT 1", $post_id)); 379 389 if ( ! $_post ) 380 390 return $null;