diff --git a/wp-includes/canonical.php b/wp-includes/canonical.php index 0c56ba24f0..b19a245bd3 100644 --- a/wp-includes/canonical.php +++ b/wp-includes/canonical.php @@ -296,6 +296,7 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) { if ( 'wp-register.php' == basename( $redirect['path'] ) ) { if ( is_multisite() ) + //duplicate_hook $redirect_url = apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) ); else $redirect_url = site_url( 'wp-login.php?action=register' ); @@ -432,8 +433,17 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) { $requested_url = preg_replace_callback('|%[a-fA-F0-9][a-fA-F0-9]|', 'lowercase_octets', $requested_url); } - // Note that you can use the "redirect_canonical" filter to cancel a canonical redirect for whatever reason by returning false - $redirect_url = apply_filters('redirect_canonical', $redirect_url, $requested_url); + /** + * Filter the canonical redirect URL. + * + * Returning false to this filter will cancel the redirect. + * + * @since 2.3.0 + * + * @param string $redirect_url The redirect URL. + * @param string $requested_url The requested URL. + */ + $redirect_url = apply_filters( 'redirect_canonical', $redirect_url, $requested_url ); if ( !$redirect_url || $redirect_url == $requested_url ) // yes, again -- in case the filter aborted the request return false;