[wp-trac] [WordPress Trac] #49759: Consider un-deprecating 'category_link' and 'tag_link' filters
WordPress Trac
noreply at wordpress.org
Wed Apr 1 16:01:29 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 | Keywords:
Focuses: |
----------------------------+--------------------
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 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 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>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list