Inline documentation for hooks in wp-includes/canonical.php.
Props dustyf for the initial patch. See #25229. git-svn-id: https://develop.svn.wordpress.org/trunk@25535 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
b647fef9d5
commit
9fd23a65e7
|
@ -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,7 +433,16 @@ 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
|
||||
/**
|
||||
* 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
|
||||
|
|
Loading…
Reference in New Issue