WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 years ago

#18455 closed defect (bug) (fixed)

Undefined index in _pad_term_counts()

Reported by: valendesigns Owned by: ryan
Milestone: 3.3 Priority: normal
Severity: normal Version: 3.2.1
Component: Taxonomy Keywords: has-patch
Focuses: Cc:

Description

When using wp_list_categories() in conjunction with a comma separated string of child category ID's and the 'show_count=1' option, the _pad_term_counts() function in taxonomy.php will return an undefined index notice on line 2806.

The fix below:

while ( isset($terms_by_id[$child]->parent) && $parent = $terms_by_id[$child]->parent ) {

Attachments (1)

18455.patch (757 bytes) - added by SergeyBiryukov 4 years ago.

Download all attachments as: .zip

Change History (3)

@SergeyBiryukov4 years ago

comment:1 @SergeyBiryukov4 years ago

  • Keywords has-patch added; needs-patch removed
  • Milestone changed from Awaiting Review to 3.3

comment:2 @ryan3 years ago

  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from new to closed

In [19077]:

Avoid undefined index notices. Props SergeyBiryukov, valendesigns. fixes #18455

Note: See TracTickets for help on using tickets.