#34187 closed enhancement (invalid)
merge wp_list_categories with wp_dropdown_categories
Reported by: | nguyenvanduocit | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Taxonomy | Keywords: | |
Focuses: | Cc: |
Description
I think function wp_list_categories and wp_dropdown_categories is the same. We can merge them into one function
Change History (2)
Note: See
TracTickets for help on using
tickets.
Hi nguyenvanduocit - Thanks for the ticket!
The two functions support many of the same parameters. But many of the default values are different. So you'd have to do some argument overriding when 'format=dropdown' that wouldn't happen when 'format=list'. The two functions use different walkers - another thing that'd have to be handled via parameter. And then they handle markup differently, since they generate very different kinds of markup, so a combined function would have lots of
if ( 'list' === $format )
types of blocks.If there are specific problems that would be solved by merging the two functions, please feel free to outline them. If this is just about reducing duplication, I don't think much duplication will, in fact, be avoided by merging. Let's not refactor for the sake of refactoring.