WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/04/2010 08:56:04 AM (9 years ago)
Author:
dd32
Message:

Cache terms under more scenario's in update_post_caches(). Fixes #15026

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r15691 r15700  
    40974097        $post_type = 'post';
    40984098
    4099     if ( !is_array($post_type) && 'any' != $post_type && $update_term_cache )
    4100         update_object_term_cache($post_ids, $post_type);
     4099    if ( $update_term_cache ) {
     4100        if ( is_array($post_type) ) {
     4101            $ptypes = $post_type;
     4102        } elseif ( 'any' == $post_type ) {
     4103            // Just use the post_types in the supplied posts.
     4104            foreach ( $posts as $post )
     4105                $ptypes[] = $post->post_type;
     4106            $ptypes = array_unique($ptypes);
     4107        } else {
     4108            $ptypes = array($post_type);
     4109        }
     4110
     4111        if ( ! empty($ptypes) )
     4112            update_object_term_cache($post_ids, $ptypes);
     4113    }
    41014114
    41024115    if ( $update_meta_cache )
Note: See TracChangeset for help on using the changeset viewer.