[wp-trac] [WordPress Trac] #29185: get_terms with parent set incorrectly hides non-empty terms

WordPress Trac noreply at wordpress.org
Mon Aug 11 21:50:57 UTC 2014


#29185: get_terms with parent set incorrectly hides non-empty terms
--------------------------+-----------------------------
 Reporter:  smerriman     |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Taxonomy      |    Version:  3.9.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 In #26903, it was reported that there was a bug when `get_terms` is called
 with `hierarchical=true` and `parent=0` - it would automatically reset
 hierarchical to false, and therefore hide parent terms which contained
 non-empty children.

 This was fixed by hardcoding a check for `parent=0`.

 However, this should apply for every other value of parent as well. For
 example, let's say I had:

 * One (0)
   * Two (0)
     * Three (2)
     * Four (3)
   * Five (0)
     * Six (2)

 Calling `get_terms` with a parent set to category 'One' will return no
 terms, while it should.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29185>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list