Update post cache before running the_posts filter. Since we already retrieved them, might as well cache them even if they are filtered out by plugins later.
git-svn-id: https://develop.svn.wordpress.org/trunk@3300 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
5a02ae79af
commit
f4579af67b
|
@ -658,13 +658,13 @@ class WP_Query {
|
|||
}
|
||||
}
|
||||
|
||||
update_post_caches($this->posts);
|
||||
|
||||
$this->posts = apply_filters('the_posts', $this->posts);
|
||||
$this->post_count = count($this->posts);
|
||||
if ($this->post_count > 0) {
|
||||
$this->post = $this->posts[0];
|
||||
}
|
||||
|
||||
update_post_caches($this->posts);
|
||||
|
||||
// Save any changes made to the query vars.
|
||||
$this->query_vars = $q;
|
||||
|
|
Loading…
Reference in New Issue