Make WordPress Core

Opened 9 years ago

Closed 6 years 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 9 years ago.
Screen Shot 2015-09-10 at 1.55.42 PM.png (44.4 KB) - added by wonderboymusic 6 years ago.
patch.diff (5.0 KB) - added by colinhahn 6 years ago.
Uses wp_registration_url to filter all register links

Download all attachments as: .zip

Change History (16)

#1 @scribu
9 years ago

Just add .diff to the end of that URL:


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

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

#2 @scribu
9 years ago

Related: #17950

#3 @chrisclayton
9 years ago

Thanks Scribu. :)

#4 @chrisclayton
9 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.

#5 @SergeyBiryukov
9 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

#6 @SergeyBiryukov
9 years ago

  • Keywords has-patch added

#7 @chriscct7
6 years ago

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

#8 follow-up: @wonderboymusic
6 years 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

#9 in reply to: ↑ 8 @colinhahn
6 years 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' ) );

6 years ago

Uses wp_registration_url to filter all register links

#10 @colinhahn
6 years ago

  • Keywords has-patch added; needs-patch removed

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

#11 @colinhahn
6 years 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.

#12 @wonderboymusic
6 years ago

  • Owner set to johnbillion

@johnbillion - see comment:11

#13 @johnbillion
6 years 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.