[wp-trac] [WordPress Trac] #13258: wp_dropdown_categories() uses $term->id instead of $term->name for taxonomies that are not categories

WordPress Trac wp-trac at lists.automattic.com
Sat May 26 17:44:08 UTC 2012


#13258: wp_dropdown_categories() uses $term->id instead of $term->name for
taxonomies that are not categories
-------------------------------------+-----------------------------
 Reporter:  mfields                  |       Owner:
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  Future Release
Component:  Taxonomy                 |     Version:  3.0
 Severity:  normal                   |  Resolution:
 Keywords:  2nd-opinion needs-patch  |
-------------------------------------+-----------------------------
Changes (by thomask):

 * keywords:  2nd-opinion => 2nd-opinion needs-patch


Comment:

 Please patch this very old bug, 2 years old you postponed to 3.1, but it
 is not even in 3.4 - tons of people got problem with this
 (http://wordpress.org/tags/wp_dropdown_categories)

 and the solution is IMO very simple - just use

 {{{
 $output .= "\t<option class=\"level-$depth\"
 value=\"".$category->term_slug."\"";
 }}}

 instead of
 {{{
 $output .= "\t<option class=\"level-$depth\"
 value=\"".$category->term_id."\"";
 }}}

 on wp-includes/category-template.php row 953 for all other taxonomies then
 $category (or even for category and change the default select name to
 category instead of cat), or add another option to wp_dropdown_categories
 e.g. 'values' with default 'term_id' and then do something like
 {{{
 $output .= "\t<option class=\"level-$depth\"
 value=\"".$category->{$values}."\"";
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/13258#comment:10>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list