mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 04:40:26 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@49905 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -7344,7 +7344,7 @@ function wp_queue_posts_for_term_meta_lazyload( $posts ) {
|
||||
$terms = get_object_term_cache( $post->ID, $taxonomy );
|
||||
if ( false !== $terms ) {
|
||||
foreach ( $terms as $term ) {
|
||||
if ( ! isset( $term_ids[ $term->term_id ] ) ) {
|
||||
if ( ! in_array( $term->term_id, $term_ids, true ) ) {
|
||||
$term_ids[] = $term->term_id;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user