[wp-trac] [WordPress Trac] #17069: missing get_term_parents() function

WordPress Trac noreply at wordpress.org
Fri Dec 9 16:02:35 UTC 2016


#17069: missing get_term_parents() function
--------------------------------------+---------------------------
 Reporter:  thomask                   |       Owner:  keesiemeijer
     Type:  enhancement               |      Status:  assigned
 Priority:  normal                    |   Milestone:  4.8
Component:  Taxonomy                  |     Version:  3.1
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+---------------------------

Comment (by boonebgorges):

 @keesiemeijer Looks great! On closer inspection, I'm going to make a
 couple minor changes:

 1. It looks like, while it's not documented as such, the old
 `get_category_parents()` would accept a term object for `$term_id`. It's
 easy to add silent support for this in `get_term_parents_list()`, so let's
 do it.
 2. I'm adding a test to demonstrate the distant-to-nearest order issue
 you're solving with `array_reverse()`.

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


More information about the wp-trac mailing list