mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Update object term cache for custom post types. props scribu, fixes #12989.
git-svn-id: https://develop.svn.wordpress.org/trunk@14310 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1626,6 +1626,9 @@ class WP_Query {
|
||||
if ( !isset($q['suppress_filters']) )
|
||||
$q['suppress_filters'] = false;
|
||||
|
||||
if ( !isset($q['cache_results']) )
|
||||
$q['cache_results'] = true;
|
||||
|
||||
if ( !isset($q['post_type']) ) {
|
||||
if ( $this->is_search )
|
||||
$q['post_type'] = 'any';
|
||||
@@ -2504,7 +2507,8 @@ class WP_Query {
|
||||
$this->posts[$i] = sanitize_post($this->posts[$i], 'raw');
|
||||
}
|
||||
|
||||
update_post_caches($this->posts);
|
||||
if ( $q['cache_results'] )
|
||||
update_post_caches($this->posts, $post_type);
|
||||
|
||||
if ($this->post_count > 0) {
|
||||
$this->post = $this->posts[0];
|
||||
|
||||
Reference in New Issue
Block a user