[wp-trac] [WordPress Trac] #49759: Consider un-deprecating 'category_link' and 'tag_link' filters

WordPress Trac noreply at wordpress.org
Fri Apr 10 04:56:13 UTC 2020


#49759: Consider un-deprecating 'category_link' and 'tag_link' filters
----------------------------+---------------------
 Reporter:  SergeyBiryukov  |       Owner:  (none)
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  5.4.1
Component:  Taxonomy        |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |     Focuses:
----------------------------+---------------------
Description changed by peterwilsoncc:

Old description:

> Background: #49738, #49755.
>
> Some history on
> [https://developer.wordpress.org/reference/hooks/category_link/
> category_link] and
> [https://developer.wordpress.org/reference/hooks/category_link/ tag_link]
> filters:
> * [15825] / #12659 turned `get_category_link()` and `get_tag_link()` into
> wrappers for `get_term_link()`, and marked the filters as "back compat"
> in a comment.
> * [27827] / #27505 marked them as deprecated in favor of `term_link`,
> though the ticket does not explain why.
> * [46684] / #48255 used `apply_filters_deprecated()` on them, so
> developers still using them now get a notice.
>
> I think these filters have the benefit of filtering the category or tag
> links without having to check the `$taxonomy` argument. In hindsight, it
> seems like they were deprecated by accident rather than an intentional
> decision.
>
> There are a couple of related filters that are not deprecated:
>
> * [https://developer.wordpress.org/reference/hooks/get_edit_tag_link/
> get_edit_tag_link]
> * [https://developer.wordpress.org/reference/hooks/edit_tag_link/
> edit_tag_link]
>
> I don't see a good reason for `category_link` and `tag_link` to stay
> deprecated.

New description:

 Background: #49738, #49755.

 Some history on
 [https://developer.wordpress.org/reference/hooks/category_link/
 category_link] and
 [https://developer.wordpress.org/reference/hooks/tag_link/ tag_link]
 filters:
 * [15825] / #12659 turned `get_category_link()` and `get_tag_link()` into
 wrappers for `get_term_link()`, and marked the filters as "back compat" in
 a comment.
 * [27827] / #27505 marked them as deprecated in favor of `term_link`,
 though the ticket does not explain why.
 * [46684] / #48255 used `apply_filters_deprecated()` on them, so
 developers still using them now get a notice.

 I think these filters have the benefit of filtering the category or tag
 links without having to check the `$taxonomy` argument. In hindsight, it
 seems like they were deprecated by accident rather than an intentional
 decision.

 There are a couple of related filters that are not deprecated:

 * [https://developer.wordpress.org/reference/hooks/get_edit_tag_link/
 get_edit_tag_link]
 * [https://developer.wordpress.org/reference/hooks/edit_tag_link/
 edit_tag_link]

 I don't see a good reason for `category_link` and `tag_link` to stay
 deprecated.

--

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


More information about the wp-trac mailing list