Ticket #12989: 12989.diff
File 12989.diff, 1.3 KB (added by , 15 years ago) |
---|
-
wp-includes/post.php
4011 4011 * @uses update_postmeta_cache() 4012 4012 * 4013 4013 * @param array $posts Array of Post objects 4014 * @param string $post_type The post type of the posts in $posts 4014 4015 */ 4015 function update_post_caches(&$posts ) {4016 function update_post_caches(&$posts, $post_type = 'post') { 4016 4017 // No point in doing all this work if we didn't match any posts. 4017 4018 if ( !$posts ) 4018 4019 return; … … 4024 4025 for ($i = 0; $i < count($posts); $i++) 4025 4026 $post_ids[] = $posts[$i]->ID; 4026 4027 4027 update_object_term_cache($post_ids, 'post'); 4028 if ( empty($post_type) ) 4029 $post_type = 'post'; 4028 4030 4031 if ( !is_array($post_type) ) 4032 update_object_term_cache($post_ids, $post_type); 4033 4029 4034 update_postmeta_cache($post_ids); 4030 4035 } 4031 4036 -
wp-includes/query.php
2497 2497 $this->posts[$i] = sanitize_post($this->posts[$i], 'raw'); 2498 2498 } 2499 2499 2500 update_post_caches($this->posts );2500 update_post_caches($this->posts, $post_type); 2501 2501 2502 2502 if ($this->post_count > 0) { 2503 2503 $this->post = $this->posts[0];