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

WordPress Trac noreply at wordpress.org
Thu Dec 8 04:12:03 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:
--------------------------------------+---------------------------
Changes (by boonebgorges):

 * keywords:  has-patch good-first-bug has-unit-tests => has-patch has-unit-
     tests
 * owner:   => keesiemeijer
 * status:  reopened => assigned
 * milestone:  Future Release => 4.8


Comment:

 @keesiemeijer Thanks for the excellent patch. A couple questions/comments:

 - I gather you're flipping the value of `$nicename` in
 `get_category_parents()` because you're changing the meaning of the param
 in `get_term_parents_list()`. I agree with your instinct that "nicename"
 doesn't really accurately describe what's happening in
 `get_category_parents()`, but if we're going to flip the meaning, we
 should just go ahead and change the parameter structure, to avoid having
 the same param name do opposite things in two related functions :). How
 about if `get_term_parents_list()` takes a 'format' argument, with
 possible values 'slug' and 'name'?
 - 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?
 - Minor code standards: negation `!` should have a space afterward (`!
 empty`, etc); last item in multiline array should be trailed by comma

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


More information about the wp-trac mailing list