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:
Andrew Nacin
2010-04-29 20:43:59 +00:00
parent 854c4d8fa7
commit fbac23f1eb
2 changed files with 13 additions and 5 deletions
+5 -1
View File
@@ -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];