Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#34187 closed enhancement (invalid)

merge wp_list_categories with wp_dropdown_categories

Reported by: nguyenvanduocit Owned by:
Priority: normal Milestone:
Component: Taxonomy Version:
Severity: normal Keywords:
Cc: Focuses:

Description

I think function wp_list_categories and wp_dropdown_categories is the same. We can merge them into one function

Change History (2)

#1 @boonebgorges
11 years ago

  • Milestone Awaiting Review
  • Resolutioninvalid
  • Status newclosed

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.

#2 @SergeyBiryukov
11 years ago

  • Component GeneralTaxonomy
Note: See TracTickets for help on using tickets.