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
This commit is contained in:
Ryan Boren 2012-11-07 20:03:28 +00:00
parent 51f16233ac
commit b21172a14a
2 changed files with 1 additions and 3 deletions

View File

@ -87,7 +87,6 @@ function set_query_var($var, $value) {
* @return array List of posts * @return array List of posts
*/ */
function query_posts($query) { function query_posts($query) {
unset($GLOBALS['wp_query']);
$GLOBALS['wp_query'] = new WP_Query(); $GLOBALS['wp_query'] = new WP_Query();
return $GLOBALS['wp_query']->query($query); return $GLOBALS['wp_query']->query($query);
} }
@ -103,7 +102,6 @@ function query_posts($query) {
* @uses $wp_query * @uses $wp_query
*/ */
function wp_reset_query() { function wp_reset_query() {
unset($GLOBALS['wp_query']);
$GLOBALS['wp_query'] = $GLOBALS['wp_the_query']; $GLOBALS['wp_query'] = $GLOBALS['wp_the_query'];
wp_reset_postdata(); wp_reset_postdata();
} }

View File

@ -233,7 +233,7 @@ $wp_the_query = new WP_Query();
* @global object $wp_query * @global object $wp_query
* @since 1.5.0 * @since 1.5.0
*/ */
$wp_query =& $wp_the_query; $wp_query = $wp_the_query;
/** /**
* Holds the WordPress Rewrite object for creating pretty URLs * Holds the WordPress Rewrite object for creating pretty URLs