Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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: http://core.svn.wordpress.org/trunk@22434 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
commit 33fe750dceacbebecfd3fa32640cb9279ef0b172 1 parent 039279d
Ryan Boren authored
Showing with 1 addition and 3 deletions.
  1. +0 −2  wp-includes/query.php
  2. +1 −1  wp-settings.php
View
2  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();
}
View
2  wp-settings.php
@@ -233,7 +233,7 @@
* @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
Please sign in to comment.
Something went wrong with that request. Please try again.