Make WordPress Core


Ignore:
Timestamp:
11/29/2022 08:25:02 PM (3 years ago)
Author:
ocean90
Message:

Revert [54892] from the 6.1 branch.

This will be added again once committed to trunk first.

See #57163.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/6.1/src/wp-includes/post.php

    r54892 r54893  
    78237823    $post_type_taxonomies = array();
    78247824    $term_ids             = array();
    7825     $prime_post_terms     = array();
    78267825    foreach ( $posts as $post ) {
    78277826        if ( ! ( $post instanceof WP_Post ) ) {
     
    78337832        }
    78347833
    7835         foreach ( $post_type_taxonomies[ $post->post_type ] as $taxonomy ) {
    7836             $prime_post_terms[ $taxonomy ][] = $post->ID;
    7837         }
    7838     }
    7839 
    7840     foreach ( $prime_post_terms as $taxonomy => $post_ids ){
    7841         wp_cache_get_multiple( $post_ids, "{$taxonomy}_relationships" );
    7842     }
    7843 
    7844     foreach ( $posts as $post ) {
    78457834        foreach ( $post_type_taxonomies[ $post->post_type ] as $taxonomy ) {
    78467835            // Term cache should already be primed by `update_post_term_cache()`.
     
    78897878 * @since 6.1.0 This function is no longer marked as "private".
    78907879 *
    7891  * @see update_post_cache()
    7892  * @see update_postmeta_cache()
    7893  * @see update_object_term_cache()
     7880 * @see update_post_caches()
    78947881 *
    78957882 * @global wpdb $wpdb WordPress database abstraction object.
     
    79067893        $fresh_posts = $wpdb->get_results( sprintf( "SELECT $wpdb->posts.* FROM $wpdb->posts WHERE ID IN (%s)", implode( ',', $non_cached_ids ) ) );
    79077894
    7908         if ( $fresh_posts ) {
    7909             // Despite the name, update_post_cache() expects an array rather than a single post.
    7910             update_post_cache( $fresh_posts );
    7911         }
    7912     }
    7913 
    7914     if ( $update_meta_cache ) {
    7915         update_postmeta_cache( $ids );
    7916     }
    7917 
    7918     if ( $update_term_cache ) {
    7919         $post_types = array_map( 'get_post_type', $ids );
    7920         $post_types = array_unique( $post_types );
    7921         update_object_term_cache( $ids, $post_types );
     7895        update_post_caches( $fresh_posts, 'any', $update_term_cache, $update_meta_cache );
    79227896    }
    79237897}
Note: See TracChangeset for help on using the changeset viewer.