[wp-trac] [WordPress Trac] #15919: wp_count_terms() hide_empty not working

WordPress Trac wp-trac at lists.automattic.com
Mon Dec 20 17:13:47 UTC 2010


#15919: wp_count_terms() hide_empty not working
--------------------------+-----------------------------
 Reporter:  zeo           |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:  has-patch
--------------------------+-----------------------------
 For tax category, `wp_count_terms( 'category', array( 'hide_empty' => true
 ) )` returns all category and doesn't hide category with post count 0.
 Instead need to use `wp_count_terms( 'category', array( 'hide_empty' =>
 true, 'hierarchical' => false ) )`.

 Since hide_empty=false is the default args, `wp_count_terms()` should set
 hierarchical=false by default too.

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


More information about the wp-trac mailing list