[wp-trac] [WordPress Trac] #29839: Enhance get_terms to return only bottom child terms (terms without children) when taxonomy is heirarchical

WordPress Trac noreply at wordpress.org
Sat Nov 15 03:29:22 UTC 2014


#29839: Enhance get_terms to return only bottom child terms (terms without
children) when taxonomy is heirarchical
--------------------------------------+------------------------------
 Reporter:  theMikeD                  |       Owner:
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Taxonomy                  |     Version:  4.0
 Severity:  normal                    |  Resolution:
 Keywords:  good-first-bug has-patch  |     Focuses:
--------------------------------------+------------------------------

Comment (by theMikeD):

 Ah, thanks Helen, that's good to know.

 So then: the patch addresses the issue in a way that preserves `child_of`
 and `hide_empty`. It's over-ridden by `all` and it's using the
 `$exclusions` list as suggested by boonebgorges. This eliminates the call
 to get_terms that the first patch had.

 The unit test function creates a 4-level custom taxonomy and tests for the
 new option (`children_only`) along with `child_of` and `hide_empty`. There
 are three tests total. The unit tests all pass.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29839#comment:22>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list