[wp-hackers] 2.next and categories functions

Ryan Boren ryan at boren.nu
Fri Mar 3 16:04:24 GMT 2006


Stefano wrote:
> I think that during this, every list tags should be reviewd and soem
> hve to be harmonized, for example having a dropdonwn_archive that
> generates the dropdown ad dropdown_cats would be nice too, sme for
> links, harmonizing all the "list" tags it's a big and hard job but
> having a more harmonized structures between various tag would be nice
> woldn't be ?

I'm doing just that in svn trunk.  Take a look at 
wp_dropdown_categories(), wp_list_categories(), wp_dropdown_pages(), and 
wp_list_pages().  I'm working on wp_list_bookmarks() right now.  I'm 
planning to harmonize the arguments passed to them while maintaining 
backwards compatibility with old arguments.

Also note that you can call these functions in two different ways now. 
You can use a query string:

wp_dropdown_categories('selected=34&hierarchical=1');

Or an associative array:

$args  = array('selected' => 34, 'hierarchical' => true);

wp_dropdown_categories($args);

Whichever you prefer. Sometimes the associative array is handy, 
especially when using compact().  Sometimes you just want to 
add_query_arg() onto a query string.

Help cleaning all of this up is appreciated, of course.  I'd like to get 
an updated 'only' patch for get_categories(), get_pages(), and 
get_bookmarks().  This stuff needs lots of testing too.

As for #2328, I think we can be even more comprehensive than that. 
Let's make our hooks wish list for these functions.

Ryan


More information about the wp-hackers mailing list