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
This commit is contained in:
parent
eb71bd2f9c
commit
40db336ea7
|
@ -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) ) {
|
||||
|
|
Loading…
Reference in New Issue