[wp-trac] [WordPress Trac] #33356: template_redirect hook for redirect_canonical() running too late

WordPress Trac noreply at wordpress.org
Wed Aug 12 19:02:53 UTC 2015


#33356: template_redirect hook for redirect_canonical() running too late
-------------------------+-----------------------------
 Reporter:  mikelopez    |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:  trunk
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 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

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33356>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list