Make WordPress Core

Opened 15 months ago

Last modified 14 months ago

#49759 closed defect (bug)

Consider un-deprecating 'category_link' and 'tag_link' filters — at Version 1

Reported by: SergeyBiryukov Owned by:
Milestone: 5.4.1 Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: has-patch
Focuses: Cc:

Description (last modified by SergeyBiryukov)

Background: #49738, #49755.

Some history on category_link and 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 are a couple of related filters that are not deprecated:

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

Change History (1)

#1 @SergeyBiryukov
15 months ago

  • Description modified (diff)
Note: See TracTickets for help on using tickets.