WordPress.org

Make WordPress Core

Ticket #14821: 14821.2.patch

File 14821.2.patch, 1.7 KB (added by johnbillion, 8 years ago)
  • post.php

     
    40894089
    40904090        update_post_cache($posts);
    40914091
    4092         $post_ids = array();
    4093         foreach ( $posts as $post )
     4092        $post_ids = $post_types = array();
     4093        foreach ( $posts as $post ) {
    40944094                $post_ids[] = $post->ID;
     4095                $post_types[] = $post->post_type;
     4096        }
    40954097
    40964098        if ( empty($post_type) )
    4097                 $post_type = 'post';
     4099                $post_type = array_unique( $post_types );
     4100        else if ( 'any' == $post_type )
     4101                $post_type = array_unique( $post_types );
    40984102
    4099         if ( !is_array($post_type) && 'any' != $post_type && $update_term_cache )
     4103        if ( $update_term_cache )
    41004104                update_object_term_cache($post_ids, $post_type);
    41014105
    41024106        if ( $update_meta_cache )
  • taxonomy.php

     
    22142214 *
    22152215 * @param string|array $object_ids Single or list of term object ID(s)
    22162216 * @param array|string $object_type The taxonomy object type
    2217  * @return null|bool Null value is given with empty $object_ids. False if
     2217 * @return null|bool Null value is given with empty $object_ids. False if all
     2218 * terms for each object are already cached.
    22182219 */
    22192220function update_object_term_cache($object_ids, $object_type) {
    22202221        if ( empty($object_ids) )
     
    22242225                $object_ids = explode(',', $object_ids);
    22252226
    22262227        $object_ids = array_map('intval', $object_ids);
     2228        $taxonomies = array();
    22272229
    2228         $taxonomies = get_object_taxonomies($object_type);
     2230        foreach ( (array) $object_type as $type )
     2231                $taxonomies = array_merge( $taxonomies, get_object_taxonomies($type) );
    22292232
    22302233        $ids = array();
    22312234        foreach ( (array) $object_ids as $id ) {