Inline documentation for hooks in wp-includes/canonical.php.

Props dustyf for the initial patch.
See #25229.

Built from https://develop.svn.wordpress.org/trunk@25535


git-svn-id: http://core.svn.wordpress.org/trunk@25455 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Drew Jaynes 2013-09-20 23:31:10 +00:00
parent a1fb6e003f
commit 0931266fc2
1 changed files with 12 additions and 2 deletions

View File

@ -296,6 +296,7 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
if ( 'wp-register.php' == basename( $redirect['path'] ) ) { if ( 'wp-register.php' == basename( $redirect['path'] ) ) {
if ( is_multisite() ) if ( is_multisite() )
//duplicate_hook
$redirect_url = apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) ); $redirect_url = apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) );
else else
$redirect_url = site_url( 'wp-login.php?action=register' ); $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); $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 if ( !$redirect_url || $redirect_url == $requested_url ) // yes, again -- in case the filter aborted the request
return false; return false;