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: http://svn.automattic.com/wordpress/trunk@6120 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
matt 2007-09-15 21:52:37 +00:00
parent 4216f95b64
commit 1e127b413c
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 {