WordPress.org

Make WordPress Core

Changeset 22434


Ignore:
Timestamp:
11/07/2012 08:03:28 PM (6 years ago)
Author:
ryan
Message:

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

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/query.php

    r22428 r22434  
    8888 */
    8989function query_posts($query) {
    90     unset($GLOBALS['wp_query']);
    9190    $GLOBALS['wp_query'] = new WP_Query();
    9291    return $GLOBALS['wp_query']->query($query);
     
    104103 */
    105104function wp_reset_query() {
    106     unset($GLOBALS['wp_query']);
    107105    $GLOBALS['wp_query'] = $GLOBALS['wp_the_query'];
    108106    wp_reset_postdata();
  • trunk/wp-settings.php

    r22094 r22434  
    234234 * @since 1.5.0
    235235 */
    236 $wp_query =& $wp_the_query;
     236$wp_query = $wp_the_query;
    237237
    238238/**
Note: See TracChangeset for help on using the changeset viewer.