mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
Cacheing cleanup. Introduce get_post() and get_category(). http://mosquito.wordpress.org/view.php?id=1157
git-svn-id: https://develop.svn.wordpress.org/trunk@2478 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -217,7 +217,7 @@ class WP_Query {
|
||||
$this->query_vars[$query_var] = $value;
|
||||
}
|
||||
|
||||
function get_posts() {
|
||||
function &get_posts() {
|
||||
global $wpdb, $pagenow, $request, $user_ID;
|
||||
|
||||
// Shorthand.
|
||||
@@ -595,7 +595,7 @@ class WP_Query {
|
||||
}
|
||||
}
|
||||
|
||||
function query($query) {
|
||||
function &query($query) {
|
||||
$this->parse_query($query);
|
||||
return $this->get_posts();
|
||||
}
|
||||
@@ -609,11 +609,9 @@ class WP_Query {
|
||||
$this->queried_object_id = 0;
|
||||
|
||||
if ($this->is_category) {
|
||||
global $cache_categories;
|
||||
if (isset($cache_categories[$this->get('cat')])) {
|
||||
$this->queried_object = $cache_categories[$this->get('cat')];
|
||||
$this->queried_object_id = $this->get('cat');
|
||||
}
|
||||
$category = &get_category($this->get('cat'));
|
||||
$this->queried_object = &$category;
|
||||
$this->queried_object_id = $this->get('cat');
|
||||
} else if ($this->is_single) {
|
||||
$this->queried_object = $this->post;
|
||||
$this->queried_object_id = $this->post->ID;
|
||||
|
||||
Reference in New Issue
Block a user