[wp-trac] [WordPress Trac] #36171: Proposed clean up of get_the_category_list() and link filter

WordPress Trac noreply at wordpress.org
Mon Mar 14 05:43:54 UTC 2016


#36171: Proposed clean up of get_the_category_list() and link filter
--------------------------------------------+-----------------------------
 Reporter:  pietergoosen                    |       Owner:
     Type:  enhancement                     |      Status:  new
 Priority:  normal                          |   Milestone:  Future Release
Component:  Taxonomy                        |     Version:  4.4.2
 Severity:  normal                          |  Resolution:
 Keywords:  needs-testing needs-unit-tests  |     Focuses:  template
--------------------------------------------+-----------------------------

Comment (by pietergoosen):

 Replying to [comment:2 boonebgorges]:
 > Hi @pietergoosen - Thanks very much for the suggested improvements.
 >
 > The changes generally look good. The DRY cleanup looks fine at a glance,
 and the additional filter will be quite welcome.
 >
 > I've reformatted your suggestions as a proper patch. See
 https://make.wordpress.org/core/handbook/tutorials/trac/submitting-a-patch/
 for more info on how patches are generated. [attachment:36171.diff]
 >
 > Unfortunately, `get_the_category_list()` currently has zero coverage by
 automated tests. Fairly decent tests are critical before we can consider
 this kind of refactor.

 Thank you for your feedback, I really appreciate it. Thanks for the
 tutorial, this is my first submit, so the tutorial will help in future ;-)

 I do agree that some testing is needed. I'm not particulary happy with how
 parent are displayed, and the fact that the new proposed filter do not
 directly target parents. I have kept the original way how the function
 handles parents for now. Ideally I would like to drop
 {{{get_category_parents()}}} from the function and let
 {{{get_the_category_list()}}} handles the parents so we can apply our
 filter on parent level as well.

 I originally thought of also applying the new proposed filter
 ({{{the_category_list_links}}}) to the {{{get_category_parents()}}}, but
 I'm not sure how useful it will be there.

 Any thoughts on this will be appreciated

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


More information about the wp-trac mailing list