[wp-trac] Re: [WordPress Trac] #2328: Provide structured access to category list

WordPress Trac wp-trac at lists.automattic.com
Sat Feb 18 12:18:15 GMT 2006

#2328: Provide structured access to category list
       Id:  2328         |      Status:  new                     
Component:  Template     |    Modified:  Sat Feb 18 12:18:15 2006
 Severity:  enhancement  |   Milestone:  2.1                     
 Priority:  normal       |     Version:  2.0.1                   
    Owner:  anonymous    |    Reporter:  coppit                  
Changes (by majelbstoat):

  * milestone:  => 2.1
  * keywords:  categories list list_cats bg|has-patch bg|commit =>
               categories list list_cats
  * version:  2.0 => 2.0.1


 This could be deserving of it's own ticket, but it's related to this so...

 The $categories argument to wp_list_cats() is useless, because I have to
 use the $args to pass it, which is a string and $categories in list_cats()
 is an object array.  I could write my own wrapper interface to
 list_cats(), but offering the same customisation as wp_list_cats()
 involves duplicating all of its argument handling code, which is a
 tremendous waste.

 The filter in the place you suggest, while useful, does not give us access
 to $sort_column, $sort_order or $exclusions, which means if we want to
 generate our own subset of categories to overwrite the given, the
 outputted list and format might not match the user's expectations.

 Three options then:

 1) Keep the filter where it is, but add those three arguments as well.
 2) Fix wp_list_cats somehow to allow categories to be specified.
 3) Remove the categories argument handler from wp_list_cats and move your
 filter into wp_list_cats, underneath the argument handling code, but
 before the call to list_cats, so that we can generate our own category

 I like option 3, but Coppit and I might have diverging views on how useful
 this is...

 At the moment, hope you don't mind, but I'd like to remove commit on this
 patch until an approach that solves both problems can be found.

Ticket URL: <http://trac.wordpress.org/ticket/2328>
WordPress Trac <http://wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list