Opened 4 years ago
Closed 4 years ago
#52144 closed defect (bug) (fixed)
the $term_ids in function wp_queue_posts_for_term_meta_lazyload is index array
Reported by: | denishua | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.7 | Priority: | normal |
Severity: | normal | Version: | 4.5 |
Component: | Posts, Post Types | Keywords: | has-patch needs-testing needs-unit-tests |
Focuses: | administration, coding-standards | Cc: |
Description
the $term_ids in function wp_queue_posts_for_term_meta_lazyload is index array,
if ( ! isset( $term_ids[ $term->term_id ] ) ) {
should change to
if ( ! in_array( $term->term_id, $term_ids ) ) {
Attachments (2)
Change History (7)
#1
@
4 years ago
- Component changed from General to Posts, Post Types
- Milestone changed from Awaiting Review to 5.7
- Owner set to SergeyBiryukov
- Status changed from new to reviewing
- Version changed from 5.6 to 4.5
@
4 years ago
I just added "if ( ! in_array( $term->term_id, $term_ids ) ) {" in wp-includes/post.php file
#2
@
4 years ago
- Focuses administration coding-standards added
- Keywords has-patch needs-testing needs-unit-tests added
#3
follow-up:
↓ 4
@
4 years ago
Thanks for the patch, @akabarikalpesh!
Just noting that we should use a strict type check for in_array()
, see [47550] and [47557] / #49542 for more context.
This is controlled by the third parameter of in_array(), so the line would look like this:
if ( ! in_array( $term->term_id, $term_ids, true ) ) {
#4
in reply to:
↑ 3
@
4 years ago
Replying to SergeyBiryukov:
Thanks for the patch, @akabarikalpesh!
Just noting that we should use a strict type check for
in_array()
, see [47550] and [47557] / #49542 for more context.
This is controlled by the third parameter of in_array(), so the line would look like this:
if ( ! in_array( $term->term_id, $term_ids, true ) ) {
I added new .diff file. please check and let me know if any changes
Hi there, welcome to WordPress Trac! Thanks for the report.
Introduced in [36566] / #35816. Setting the Version field to 4.5 as the earliest affected version.