Sometimes the $page global is set but it's just an integer, like 1, not an object which we should try to address and put in the cache. The page would work but we'd do spurious wp_cache_add

git-svn-id: https://develop.svn.wordpress.org/trunk@6120 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2007-09-15 21:52:37 +00:00
parent c1eda9c8c6
commit 092bbfb049
1 changed files with 1 additions and 1 deletions

View File

@ -974,7 +974,7 @@ function &get_page(&$page, $output = OBJECT) {
global $wpdb, $blog_id;
if ( empty($page) ) {
if ( isset($GLOBALS['page']) ) {
if ( isset( $GLOBALS['page'] ) && isset( $GLOBALS['page']->ID ) ) {
$_page = & $GLOBALS['page'];
wp_cache_add($_page->ID, $_page, 'pages');
} else {