Changeset 14310
- Timestamp:
- 04/29/2010 08:43:59 PM (15 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r14295 r14310 3983 3983 * 3984 3984 * @param array $posts Array of Post objects 3985 */ 3986 function update_post_caches(&$posts) { 3985 * @param string $post_type The post type of the posts in $posts 3986 */ 3987 function update_post_caches(&$posts, $post_type = 'post') { 3987 3988 // No point in doing all this work if we didn't match any posts. 3988 3989 if ( !$posts ) … … 3992 3993 3993 3994 $post_ids = array(); 3994 3995 for ($i = 0; $i < count($posts); $i++) 3996 $post_ids[] = $posts[$i]->ID; 3997 3998 update_object_term_cache($post_ids, 'post'); 3995 foreach ( $posts as $post ) 3996 $post_ids[] = $post->ID; 3997 3998 if ( empty($post_type) ) 3999 $post_type = 'post'; 4000 4001 if ( !is_array($post_type) && 'any' != $post_type ) 4002 update_object_term_cache($post_ids, $post_type); 3999 4003 4000 4004 update_postmeta_cache($post_ids); -
trunk/wp-includes/query.php
r14245 r14310 1627 1627 $q['suppress_filters'] = false; 1628 1628 1629 if ( !isset($q['cache_results']) ) 1630 $q['cache_results'] = true; 1631 1629 1632 if ( !isset($q['post_type']) ) { 1630 1633 if ( $this->is_search ) … … 2505 2508 } 2506 2509 2507 update_post_caches($this->posts); 2510 if ( $q['cache_results'] ) 2511 update_post_caches($this->posts, $post_type); 2508 2512 2509 2513 if ($this->post_count > 0) {
Note: See TracChangeset
for help on using the changeset viewer.