[wp-trac] [WordPress Trac] #9227: in get_the_category_list(), filter categories before constructing list

WordPress Trac noreply at wordpress.org
Thu Jun 5 00:22:05 UTC 2014


#9227: in get_the_category_list(), filter categories before constructing list
-----------------------------------+-----------------------------
 Reporter:  KevinB                 |       Owner:  wonderboymusic
     Type:  enhancement            |      Status:  assigned
 Priority:  normal                 |   Milestone:  4.0
Component:  Taxonomy               |     Version:  2.8
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:  template
-----------------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * keywords:  has-patch commit => has-patch 2nd-opinion


Comment:

 1. In [attachment:9227.4.diff], `$categories` should be an array rather
 than array|bool, because [source:tags/3.9.1/src/wp-includes/category-
 template.php#L65 get_the_category()] always returns an array. The docs
 need to be adjusted as well.
 2. [source:tags/3.9.1/src/wp-includes/category-template.php#L85
 get_the_categories] filter was added in [16332]. Is there a use case that
 cannot be achieved using that filter? You can conditionally apply it on
 front-end as needed. We don't pass the post ID there, perhaps we should do
 that instead of introducing a new filter.

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


More information about the wp-trac mailing list