WordPress.org

Make WordPress Core

Changeset 49905


Ignore:
Timestamp:
12/24/2020 11:19:29 AM (3 weeks ago)
Author:
SergeyBiryukov
Message:

Posts, Post Types: Correct the check for term IDs to be queued for lazy-loading term meta.

This ensures that the $term_ids array in wp_queue_posts_for_term_meta_lazyload() (an indexed array not keyed by ID) does not contain duplicate values.

Props denishua, akabarikalpesh.
Fixes #52144.

File:
1 edited

Legend:

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

    r49790 r49905  
    73457345            if ( false !== $terms ) {
    73467346                foreach ( $terms as $term ) {
    7347                     if ( ! isset( $term_ids[ $term->term_id ] ) ) {
     7347                    if ( ! in_array( $term->term_id, $term_ids, true ) ) {
    73487348                        $term_ids[] = $term->term_id;
    73497349                    }
Note: See TracChangeset for help on using the changeset viewer.