Make WordPress Core

Opened 3 years ago

Closed 12 days ago

#23087 closed enhancement (fixed)

Filter wp-register.php canonical redirect in single site too

Reported by: chrisclayton Owned by: johnbillion
Milestone: 4.4 Priority: normal
Severity: normal Version:
Component: Canonical Keywords: good-first-bug has-patch
Focuses: Cc:


in canonical registration location redirecting we have a filter for MS but none for WP Single Site. I'm unsure of how to convert Git patches to svn, so... yeah... Sorry.


Attachments (3)

449ac581ff45bfd68050280cdad6211d907ca12f.diff (613 bytes) - added by chrisclayton 3 years ago.
Screen Shot 2015-09-10 at 1.55.42 PM.png (44.4 KB) - added by wonderboymusic 4 weeks ago.
patch.diff (5.0 KB) - added by colinhahn 4 weeks ago.
Uses wp_registration_url to filter all register links

Download all attachments as: .zip

Change History (16)

comment:1 @scribu3 years ago

Just add .diff to the end of that URL:


Or run git diff --no-prefix > 23087.diff

Last edited 3 years ago by scribu (previous) (diff)

comment:2 @scribu3 years ago

Related: #17950

comment:3 @chrisclayton3 years ago

Thanks Scribu. :)

comment:4 @chrisclayton3 years ago

  • Summary changed from canonical redirect filter to apply_filters to redirect_canonical if we're not multi site.

Modifying the Summary to clarify ticket.

comment:5 @SergeyBiryukov3 years ago

  • Summary changed from apply_filters to redirect_canonical if we're not multi site. to Filter wp-register.php canonical redirect in single site too

comment:6 @SergeyBiryukov3 years ago

  • Keywords has-patch added

comment:7 @chriscct76 weeks ago

  • Keywords needs-refresh added
  • Milestone changed from Awaiting Review to 4.4
  • Owner set to chriscct7
  • Status changed from new to assigned

comment:8 follow-up: @wonderboymusic4 weeks ago

  • Keywords needs-patch good-first-bug added; has-patch needs-refresh removed
  • Owner chriscct7 deleted

We should make a function that returns the URL - the func will contain the filter

comment:9 in reply to: ↑ 8 @colinhahn4 weeks ago

Isn't that covered by the existing function wp_registration_url()?

function wp_registration_url() {
	 * Filter the user registration URL.
	 * @since 3.6.0
	 * @param string $register The user registration URL.
	return apply_filters( 'register_url', site_url( 'wp-login.php?action=register', 'login' ) );

@colinhahn4 weeks ago

Uses wp_registration_url to filter all register links

comment:10 @colinhahn3 weeks ago

  • Keywords has-patch added; needs-patch removed

Would love some feedback on the patch I uploaded 11 Sept.

comment:11 @colinhahn3 weeks ago

  • Keywords dev-feedback added

It looks like some of the code that my patch addressed has been addressed independently in ticket #31495, committed by @johnbillion in changeset [34213]. One difference is that my patch made the scheme default null, so each of the replacements specifies that it's a login context. I'm happy to submit another patch that adds that to the work in [34213] if desired.

The benefit of having the scheme passed in the function parameter is that it's a little clearer what the context is at the point that the function call is made, and it parallels the way $scheme is passed in other functions.

comment:12 @wonderboymusic3 weeks ago

  • Owner set to johnbillion

@johnbillion - see comment:11

comment:13 @johnbillion12 days ago

  • Keywords dev-feedback removed
  • Resolution set to fixed
  • Status changed from assigned to closed

Thanks for the info @colinhahn. Sorry this was addressed in another ticket and you didn't get props!

The reason there's no $scheme parameter for wp_registration_url() is the same reason there's none for wp_login_url() - the scheme must always be login. See also my comment about the login and login_post schemes.

Closing this as fixed in r34213.

Note: See TracTickets for help on using tickets.