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

WordPress Trac noreply at wordpress.org
Thu Dec 8 14:09:48 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 keesiemeijer):

 I agree, flipping the value in `get_category_parents()` feels off and
 doesn't give it any meaning of what the value actually does . With a
 format value we can give the meaning back and make it much more readable
 in both functions.

 >>Why `array_reverse()` before generating the markup? Does
 `get_ancestors()` return values in a reverse order from the way that
 `get_category_parents()` currently does it?

 Yes, `get_ancestors()` returns the terms from the child up, while
 `get_category_parents()` displays it from the last parent down.

 A new patch is on its way :)

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


More information about the wp-trac mailing list