Make WordPress Core

Opened 14 years ago

Closed 11 years ago

#16240 closed defect (bug) (invalid)

hide_empty doesn't work in get_terms() when hierarchical isn't set to false

Reported by: markjaquith's profile markjaquith Owned by: markjaquith's profile markjaquith
Milestone: Priority: high
Severity: major Version:
Component: Taxonomy Keywords: close
Focuses: Cc:

Description

I end up with some 0-count categories when calling get_terms( 'category', array( 'hide_empty' => true ) )

I think it has to do with the child count logic.

Change History (4)

#1 @wonderboymusic
12 years ago

  • Keywords reporter-feedback added; 3.2-early removed

I can't reproduce the issue - any use cases?

#2 @SergeyBiryukov
12 years ago

With both hierarchical and hide_empty set to true, empty categories are only returned if they have non-empty children.

There's a block in get_terms() for that (introduced in [4104]):
http://core.trac.wordpress.org/browser/tags/3.4.2/wp-includes/taxonomy.php#L1402

#3 @nacin
12 years ago

  • Keywords close added
  • Status changed from new to assigned

Seems deliberate then.

#4 @wonderboymusic
11 years ago

  • Keywords reporter-feedback removed
  • Milestone Future Release deleted
  • Resolution set to invalid
  • Status changed from assigned to closed

Nacin marked close 11 months ago, no chatter since then

Note: See TracTickets for help on using tickets.