WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 4 months ago

#33356 new enhancement

template_redirect hook for redirect_canonical() running too late

Reported by: mikelopez Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.3
Component: General Keywords:
Focuses: Cc:
PR Number:

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 (0)

Note: See TracTickets for help on using tickets.