Fix up get_page cache handling.

git-svn-id: https://develop.svn.wordpress.org/trunk@4624 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2006-12-07 01:06:28 +00:00
parent db72b3d6b8
commit 9271589a5a
1 changed files with 2 additions and 2 deletions

View File

@ -939,9 +939,9 @@ function &get_page(&$page, $output = OBJECT) {
if ( isset($GLOBALS['page']->ID) && ($page == $GLOBALS['page']->ID) ) {
$_page = & $GLOBALS['page'];
wp_cache_add($_page->ID, $_page, 'pages');
} elseif ( !isset($_page) && $_page == $GLOBALS['post_cache'][$blog_id][$page] ) {
} elseif ( isset($GLOBALS['post_cache'][$blog_id][$page]) ) {
return get_post($page, $output);
} elseif ( isset($_page) && $_page == wp_cache_get($page, 'pages') ) {
} elseif ( $_page = wp_cache_get($page, 'pages') ) {
// Got it.
} else {
$query = "SELECT * FROM $wpdb->posts WHERE ID= '$page' LIMIT 1";