mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +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. Built from https://develop.svn.wordpress.org/trunk@49905 git-svn-id: http://core.svn.wordpress.org/trunk@49604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c81db1f6e6
commit
5a7fa8b7f3
@ -7344,7 +7344,7 @@ function wp_queue_posts_for_term_meta_lazyload( $posts ) {
|
|||||||
$terms = get_object_term_cache( $post->ID, $taxonomy );
|
$terms = get_object_term_cache( $post->ID, $taxonomy );
|
||||||
if ( false !== $terms ) {
|
if ( false !== $terms ) {
|
||||||
foreach ( $terms as $term ) {
|
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;
|
$term_ids[] = $term->term_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.7-alpha-49904';
|
$wp_version = '5.7-alpha-49905';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user