Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#32330 closed defect (bug) (fixed)

Option not selected in Walker_CategoryDropdown

Reported by: tlexcellent's profile tlexcellent Owned by: boonebgorges's profile boonebgorges
Milestone: 4.3 Priority: normal
Severity: normal Version: 4.3
Component: Taxonomy Keywords:
Focuses: template Cc:

Description

In function start_el() of class Walker_CategoryDropdown (wp-includes/category-template.php), when argument value_field is set, selected option should check value_field and not always term_id.

Change :

if ( $category->term_id == $args['selected'] )
  $output .= ' selected="selected"';

For :

if ( $category->{$args['value_field']} == $args['selected'] )
  $output .= ' selected="selected"';

Change History (2)

#1 @boonebgorges
10 years ago

  • Component changed from General to Taxonomy
  • Focuses template added
  • Milestone changed from Awaiting Review to 4.3

Good find. Thanks for the report, tlexcellent.

#2 @boonebgorges
10 years ago

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

In 32484:

In category dropdown, 'selected' should match against 'value_field'.

Props tlexcellent.
Fixes #32330.

Note: See TracTickets for help on using tickets.