[wp-trac] [WordPress Trac] #35561: function wp_admin_canonical_url() not using configured site url when constructing canonical url link tag

WordPress Trac noreply at wordpress.org
Fri Jan 22 20:09:23 UTC 2016


#35561: function wp_admin_canonical_url() not using configured site url when
constructing canonical url link tag
-------------------------------+------------------------------
 Reporter:  ilude              |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Administration     |     Version:  4.4.1
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  administration
-------------------------------+------------------------------

Comment (by ilude):

 If the reverse proxy setup was incorrect the non administration sections
 of the site would not function. Those sections are not relying on the
 {{{$_SERVER['REQUEST_URI']}}} var to contain the /blog prefix in the url.
 They correctly use the SITE_URL setting to create their links.

 The admin section is not behaving the same way, it is ignoring the
 SITE_URL setting and trying to generate the canonical url using request
 parameters. What I'm trying to explain is that the bug is that the admin
 section is generating the canonical url differently than the non admin
 sections of the site. If I adjust my configuration the way you suggest the
 non admin sections will generate incorrect urls.

 The issue is not a proxy configuration issue is the inconsistent url
 generation differences between the non admin and admin sections of the
 site.

 The [https://developer.wordpress.org/reference/functions/rel_canonical/
 rel_canonical()] function that the non admin sections rely on uses
 [https://developer.wordpress.org/reference/functions/get_permalink/
 get_permalink()] function that in turn relies the home_url() function.
 Which is why I suggested using that as the fix, so that the admin section
 behaved the same as the non admin section when generating urls.

 Now perhaps I'm missing something important, because I'm not a wordpress
 developer, with relying on home_url() in the admin section, but regardless
 the behavior needs to be consistent.

 Providing consistent behavior would also make plugins like this unneeded
 as well [http://chooseplugin.com/plugin-info/remove-wp-canonical-url-
 admin-hack/]

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35561#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list