Changeset 4460

Show
Ignore:
Timestamp:
11/09/06 06:50:58 (2 years ago)
Author:
ryan
Message:

Preserve the original query object as wp_the_query so that it's not stomped by subsequent calls to query_posts().

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/classes.php

    r4458 r4460  
    250250 
    251251    function query_posts() { 
     252        global $wp_the_query; 
    252253        $this->build_query_string(); 
    253         query_posts($this->query_vars); 
     254        $wp_the_query->query($this->query_vars); 
    254255    } 
    255256 
  • trunk/wp-includes/query.php

    r4457 r4460  
    1212 
    1313function &query_posts($query) { 
    14     global $wp_query; 
    15     return $wp_query->query($query); 
     14    unset($GLOBALS['wp_query']); 
     15    $GLOBALS['wp_query'] =& new WP_Query(); 
     16    return $GLOBALS['wp_query']->query($query); 
    1617} 
    1718 
  • trunk/wp-settings.php

    r4452 r4460  
    227227do_action('sanitize_comment_cookies'); 
    228228 
    229 $wp_query   = new WP_Query(); 
    230 $wp_rewrite = new WP_Rewrite(); 
    231 $wp         = new WP(); 
     229$wp_the_query =& new WP_Query(); 
     230$wp_query     =& $wp_the_query; 
     231$wp_rewrite   =& new WP_Rewrite(); 
     232$wp           =& new WP(); 
    232233 
    233234validate_current_theme();