[wp-testers] get_categories

Matthew Robinson mattyrobuk at googlemail.com
Wed Apr 18 19:55:22 GMT 2007


I have a plugin called Subscribe2 (subscribe2.wordpress.com) that  
makes use of the get_categories function in WordPress 2.1.x

I currently use it as follows:

get_categories('type=post&hide_empty=1&hierarchical=0')

to allow users to subscribe to certain post categories but not others.

I have been asked to allow users to subscribe to categories that are  
currently empty but when I change the above command to:

get_categories('type=post&hide_empty=0&hierarchical=0')

I also get link categories in the results.

I've looked through the code (in wp-includes/category.php) and I can  
see a conditional statement that would allow for collection of only  
post categories (empty or otherwise). Is there a way to d this or is  
it a feature request for the trac?

Cheers,
Matt


More information about the wp-testers mailing list