From 0931266fc2f12e187009ef283e362c40a005093b Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Fri, 20 Sep 2013 23:31:10 +0000 Subject: [PATCH] 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 --- wp-includes/canonical.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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;