[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
Sun Nov 23 17:28:03 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: Future Release
Component: Taxonomy | Version: 4.0
Severity: normal | Resolution:
Keywords: 4.2-early has-patch | Focuses:
---------------------------------+-----------------------------
Comment (by boonebgorges):
> In the description of this ticket it describes adding a parameter that
does the opposite of parent, so shouldn't it live up to that a little bit
more?
I think that phrase in the original ticket description was ill-chosen.
What the discussion quickly turned to was the fetching of "leaf" or
"terminal" nodes. See eg
https://core.trac.wordpress.org/ticket/29839#comment:6
> If this stays named childless and we decide to proceed at some point in
the future with that second enhancement merging the two would be confusing
at best.
There would be no merging, just the possible addition of separate
parameters. I guess 'child' would take an integer and return an array with
a maximum of one member, which would be the direct parent (since 'parent'
returns only direct descendants - though tbh I find this naming convention
to be pretty confusing). 'ancestor_of' would take an integer and return an
array of all ancestors. In any case, these params have very different use
cases from what's described in the latest patch, and the two are not at
odds with each other. If you have a use case for one of these other ideas,
please feel free to open a separate ticket describing that case, with a
patch if you wish to provide one.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29839#comment:53>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list