From 40db336ea7d29b9a59a0a9e524f926413d1460e4 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 19 May 2009 16:16:15 +0000 Subject: [PATCH] Reset post-related globals in wp_reset_query(). Props Denis-de-Bernardy. fixes #9256 git-svn-id: http://svn.automattic.com/wordpress/trunk@11400 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/query.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index 32a7b8cebd..325d7ef674 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -73,7 +73,8 @@ function &query_posts($query) { * @uses $wp_query */ function wp_reset_query() { - unset($GLOBALS['wp_query']); + foreach ( array('id', 'authordata', 'day', 'currentmonth', 'page', 'pages', 'multipage', 'more', 'numpages', 'post', 'wp_query') as $var ) + unset($GLOBALS[$var]); $GLOBALS['wp_query'] =& $GLOBALS['wp_the_query']; global $wp_query; if ( !empty($wp_query->post) ) {