WordPress.org

Make WordPress Core

Opened 8 weeks ago

Closed 6 weeks ago

Last modified 6 weeks ago

#49759 closed defect (bug) (fixed)

Consider un-deprecating 'category_link' and 'tag_link' filters

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

Description (last modified by peterwilsoncc)

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 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:

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

Attachments (1)

49759.diff (1.1 KB) - added by audrasjb 7 weeks ago.
Taxonomy: Undeprecate tag_link and category_link filters

Download all attachments as: .zip

Change History (14)

#1 @SergeyBiryukov
8 weeks ago

  • Description modified (diff)

#2 @SergeyBiryukov
8 weeks ago

  • Description modified (diff)

This ticket was mentioned in Slack in #core by sergey. View the logs.


8 weeks ago

This ticket was mentioned in Slack in #core by whyisjake. View the logs.


7 weeks ago

#5 @audrasjb
7 weeks ago

Hi,

Yes, I got a notice on my blog’s Archive pages using Twenty Twenty and a bunch of plugins…
I agree it’s better to un-deprecate those two filters.

@audrasjb
7 weeks ago

Taxonomy: Undeprecate tag_link and category_link filters

#6 @audrasjb
7 weeks ago

  • Keywords has-patch added

#7 @peterwilsoncc
7 weeks ago

  • Description modified (diff)

#8 @whyisjake
6 weeks ago

  • Owner set to whyisjake
  • Resolution set to fixed
  • Status changed from new to closed

In 47576:

Taxonomy: Un-depracate category_link and tag_link filters.

Depracating these filter might have been an accident, so let's restore.

Props SergeyBiryukov, audrasjb, peterwilsoncc.
Fixes #49759.

#9 @whyisjake
6 weeks ago

In 47577:

Taxonomy: Un-depracate category_link and tag_link filters.

Depracating these filter might have been an accident, so let's restore.

Props SergeyBiryukov, audrasjb, peterwilsoncc.

Fixes #49759 for the 5.4 branch.

#10 @SergeyBiryukov
6 weeks ago

In 47578:

Docs: Add a @since note for un-deprecated category_link and tag_link filters.

Follow-up to [47576].

See #49759.

#11 @SergeyBiryukov
6 weeks ago

In 47579:

Docs: Add a @since note for un-deprecated category_link and tag_link filters.

Follow-up to [47576].

Merges [47578] to the 5.4 branch.
See #49759.

#12 follow-up: @antonine
6 weeks ago

This update made my life hell, how do i downgrade wordpress? I forgot to backup and I trusted that it would not give error.

#13 in reply to: ↑ 12 @SergeyBiryukov
6 weeks ago

Replying to antonine:

This update made my life hell, how do i downgrade wordpress?

Hi there, I'm sorry to hear you are having issues with WordPress. Please note that this Trac is used for enhancements and bug reporting for the WordPress core software, not for individual support questions.

Please try the support forums to get help with your site: https://wordpress.org/support/forums/.

Note: See TracTickets for help on using tickets.