#30306 closed enhancement (fixed)
wp_dropdown_categories values as slug
Reported by: | gputignano | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 4.2 | Priority: | normal |
Severity: | normal | Version: | 4.0 |
Component: | Taxonomy | Keywords: | has-patch dev-feedback |
Focuses: | Cc: |
Description
wp_dropdown_categories returns value attribute in option tag as a numeric value. It could be better to choose it between an id or slug. For example if I want to filter a post list by a taxonomy I have to set taxonomy value to slug in global $query var.
Attachments (2)
Change History (10)
#1
@
10 years ago
This isn't a bad idea. You could add an argument to the wp_dropdown_categories() called 'value_field' and set the value as 'slug' or any other part of the $category object (e.g. 'name').
#5
@
10 years ago
- Milestone changed from Awaiting Review to 4.2
This seems like a good idea, and will mitigate the issue described in #30865. Let's do it.
Note: See
TracTickets for help on using
tickets.
value_field argument