Opened 6 years ago
Closed 6 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 |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.7 |
| Component: | Posts, Post Types | Version: | 4.5 |
| Severity: | normal | Keywords: | has-patch needs-testing needs-unit-tests |
| Cc: | Focuses: | administration, coding-standards |
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
@
6 years ago
- Component General → Posts, Post Types
- Milestone Awaiting Review → 5.7
- Owner set to
- Status new → reviewing
- Version 5.6 → 4.5
@
6 years ago
I just added "if ( ! in_array( $term->term_id, $term_ids ) ) {" in wp-includes/post.php file
#2
@
6 years ago
- Focuses administration coding-standards added
- Keywords has-patch needs-testing needs-unit-tests added
#3
follow-up:
↓ 4
@
6 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
@
6 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
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.