Changeset 14310 for trunk/wp-includes/post.php
- Timestamp:
- 04/29/2010 08:43:59 PM (15 years ago)
- File:
-
- 1 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);
Note: See TracChangeset
for help on using the changeset viewer.