Don't overwrite global request when starting a new query.
git-svn-id: http://svn.automattic.com/wordpress/trunk@3426 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3904108d96
commit
96abeca9f3
|
@ -5,6 +5,7 @@ class WP_Query {
|
||||||
var $query_vars;
|
var $query_vars;
|
||||||
var $queried_object;
|
var $queried_object;
|
||||||
var $queried_object_id;
|
var $queried_object_id;
|
||||||
|
var $request;
|
||||||
|
|
||||||
var $posts;
|
var $posts;
|
||||||
var $post_count = 0;
|
var $post_count = 0;
|
||||||
|
@ -257,7 +258,7 @@ class WP_Query {
|
||||||
}
|
}
|
||||||
|
|
||||||
function &get_posts() {
|
function &get_posts() {
|
||||||
global $wpdb, $pagenow, $request, $user_ID;
|
global $wpdb, $pagenow, $user_ID;
|
||||||
|
|
||||||
do_action('pre_get_posts', array(&$this));
|
do_action('pre_get_posts', array(&$this));
|
||||||
|
|
||||||
|
@ -643,9 +644,9 @@ class WP_Query {
|
||||||
$orderby = "post_" . $q['orderby'];
|
$orderby = "post_" . $q['orderby'];
|
||||||
$orderby = apply_filters('posts_orderby', $orderby);
|
$orderby = apply_filters('posts_orderby', $orderby);
|
||||||
$request = " SELECT $distinct * FROM $wpdb->posts $join WHERE 1=1" . $where . " GROUP BY " . $groupby . " ORDER BY " . $orderby . " $limits";
|
$request = " SELECT $distinct * FROM $wpdb->posts $join WHERE 1=1" . $where . " GROUP BY " . $groupby . " ORDER BY " . $orderby . " $limits";
|
||||||
$request = apply_filters('posts_request', $request);
|
$this->request = apply_filters('posts_request', $request);
|
||||||
|
|
||||||
$this->posts = $wpdb->get_results($request);
|
$this->posts = $wpdb->get_results($this->request);
|
||||||
|
|
||||||
// Check post status to determine if post should be displayed.
|
// Check post status to determine if post should be displayed.
|
||||||
if ($this->is_single) {
|
if ($this->is_single) {
|
||||||
|
@ -1667,6 +1668,7 @@ class WP {
|
||||||
$GLOBALS['query_string'] = & $this->query_string;
|
$GLOBALS['query_string'] = & $this->query_string;
|
||||||
$GLOBALS['posts'] = & $wp_query->posts;
|
$GLOBALS['posts'] = & $wp_query->posts;
|
||||||
$GLOBALS['post'] = & $wp_query->post;
|
$GLOBALS['post'] = & $wp_query->post;
|
||||||
|
$GLOBALS['request'] = & $wp_query->request;
|
||||||
|
|
||||||
if ( is_single() || is_page() ) {
|
if ( is_single() || is_page() ) {
|
||||||
$GLOBALS['more'] = 1;
|
$GLOBALS['more'] = 1;
|
||||||
|
|
Loading…
Reference in New Issue