mirror of
git://develop.git.wordpress.org/
synced 2025-02-25 09:03:09 +01:00
get_post() should check post cache before page cache. fixes #3724
git-svn-id: https://develop.svn.wordpress.org/trunk@4847 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
0db117a5b6
commit
fb8f9d400a
@ -105,10 +105,10 @@ function &get_post(&$post, $output = OBJECT) {
|
||||
$post_cache[$blog_id][$post->ID] = &$post;
|
||||
$_post = & $post_cache[$blog_id][$post->ID];
|
||||
} else {
|
||||
if ( $_post = wp_cache_get($post, 'pages') )
|
||||
return get_page($_post, $output);
|
||||
elseif ( isset($post_cache[$blog_id][$post]) )
|
||||
if ( isset($post_cache[$blog_id][$post]) )
|
||||
$_post = & $post_cache[$blog_id][$post];
|
||||
elseif ( $_post = wp_cache_get($post, 'pages') )
|
||||
return get_page($_post, $output);
|
||||
else {
|
||||
$query = "SELECT * FROM $wpdb->posts WHERE ID = '$post' LIMIT 1";
|
||||
$_post = & $wpdb->get_row($query);
|
||||
|
Loading…
x
Reference in New Issue
Block a user