Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#49759 closed defect (bug) (fixed)

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

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: whyisjake's profile 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 5 years ago.
Taxonomy: Undeprecate tag_link and category_link filters

Download all attachments as: .zip

Change History (14)

#1 @SergeyBiryukov
5 years ago

  • Description modified (diff)

#2 @SergeyBiryukov
5 years ago

  • Description modified (diff)

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


5 years ago

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


5 years ago

#5 @audrasjb
5 years 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
5 years ago

Taxonomy: Undeprecate tag_link and category_link filters

#6 @audrasjb
5 years ago

  • Keywords has-patch added

#7 @peterwilsoncc
5 years ago

  • Description modified (diff)

#8 @whyisjake
5 years 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
5 years 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
5 years 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
5 years 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
5 years 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
5 years 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.