From 092bbfb049d84c5fda77b35c6a74f17005be63f0 Mon Sep 17 00:00:00 2001 From: Matt Mullenweg Date: Sat, 15 Sep 2007 21:52:37 +0000 Subject: [PATCH] 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 --- wp-includes/post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index c40e853bc8..076e6133aa 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -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 {