From b21172a14a45129b369c7a8b82436fc5fd1b5456 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 7 Nov 2012 20:03:28 +0000 Subject: [PATCH] Don't assign wp_the_query to wp_query by reference. Removing the ref avoids accidentally stomping wp_the_query. Props scribu, wpmuguru fixes #22125 git-svn-id: https://develop.svn.wordpress.org/trunk@22434 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/query.php | 2 -- wp-settings.php | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index 66311fffae..fe3e24f0ed 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -87,7 +87,6 @@ function set_query_var($var, $value) { * @return array List of posts */ function query_posts($query) { - unset($GLOBALS['wp_query']); $GLOBALS['wp_query'] = new WP_Query(); return $GLOBALS['wp_query']->query($query); } @@ -103,7 +102,6 @@ function query_posts($query) { * @uses $wp_query */ function wp_reset_query() { - unset($GLOBALS['wp_query']); $GLOBALS['wp_query'] = $GLOBALS['wp_the_query']; wp_reset_postdata(); } diff --git a/wp-settings.php b/wp-settings.php index 470ed9a77a..ac331c2cf4 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -233,7 +233,7 @@ $wp_the_query = new WP_Query(); * @global object $wp_query * @since 1.5.0 */ -$wp_query =& $wp_the_query; +$wp_query = $wp_the_query; /** * Holds the WordPress Rewrite object for creating pretty URLs