Make WordPress Core

Opened 9 years ago

Closed 4 years ago

Last modified 3 years ago

#33356 closed enhancement (wontfix)

template_redirect hook for redirect_canonical() running too late

Reported by: mikelopez's profile mikelopez Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.3
Component: Canonical Keywords:
Focuses: Cc:

Description

Hi

The template_redirect for redirect_canonical() currently runs with default priority.

I believe it should run with a priority of 1 for the following reasons:

  • Any other plugin/theme hooking to template_redirect with a higher priority will run under the wrong canonical URL.
  • Furthermore, if the plugin/theme needs to check for the current user, then it will only see that there is no user logged in because no cookie are set due to the browser being on the wrong URL at this point.
  • redirect_canonical() is a pretty important function and having the proper canonical URL before anything else probably have more pros than cons.

Thoughts?

Thanks.

Mike

Change History (5)

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


4 years ago

#2 @talldanwp
4 years ago

  • Keywords reporter-feedback added

Hey @mikelopez, Thanks for creating the ticket, and apologies it took a while for a response.

This ticket was discussed in a triage session in slack (the link is above this message).

One concern with changing the priority is it could lead to some backwards compatibility issues if other code relies on the current behaviour.

Is this currently causing a bug, or is it something you feel could be improved?

#3 @mikelopez
4 years ago

Hi @talldanwp

No worries. I know you guys are busy. I think this can be closed. It's been a while and I can't remember the exact details but it was a conflict between a theme (can't remember too) and WishList Member.

I'll open another ticket with more detail if we encounter this again.

Thanks.

#4 @talldanwp
4 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

Thanks @mikelopez, will close this now.

#5 @SergeyBiryukov
4 years ago

  • Component changed from General to Canonical
  • Keywords reporter-feedback removed
Note: See TracTickets for help on using tickets.