[wp-trac] [WordPress Trac] #30415: Allow get_category_parents() to be used for any taxonomy

WordPress Trac noreply at wordpress.org
Thu Nov 20 10:38:11 UTC 2014


#30415: Allow get_category_parents() to be used for any taxonomy
----------------------------------------+------------------------------
 Reporter:  hlashbrooke                 |       Owner:
     Type:  enhancement                 |      Status:  new
 Priority:  normal                      |   Milestone:  Awaiting Review
Component:  Taxonomy                    |     Version:  trunk
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:
----------------------------------------+------------------------------

Comment (by ChriCo):

 On your current patch: 30415.diff

 L1399
 > @return string|WP_Error A list of category parents on success, WP_Error
 on failure.

 why then `return false;` ? :-)

 L1421
 > $chain .= get_category_parents( $parent->parent, $link, $separator,
 $nicename, $visited );

 shouldn't you call `get_term_parents()` ?

 and a note from my side: Wouldn't it better to implement a function which
 returns the a tree (array) with parent => child ?

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


More information about the wp-trac mailing list