Make WordPress Core

Ticket #25229: wp-includes-canonical.diff

File wp-includes-canonical.diff, 1.4 KB (added by dustyf, 11 years ago)

First pass at wp-includes/canonical.php

  • wp-includes/canonical.php

     
    296296
    297297                if ( 'wp-register.php' == basename( $redirect['path'] ) ) {
    298298                        if ( is_multisite() )
     299                                //duplicate_hook
    299300                                $redirect_url = apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) );
    300301                        else
    301302                                $redirect_url = site_url( 'wp-login.php?action=register' );
     
    432433                $requested_url = preg_replace_callback('|%[a-fA-F0-9][a-fA-F0-9]|', 'lowercase_octets', $requested_url);
    433434        }
    434435
    435         // Note that you can use the "redirect_canonical" filter to cancel a canonical redirect for whatever reason by returning false
     436        /**
     437         * Filter the URLs for canonical redirects.
     438         *
     439         * The requested url and the url that will be redirected to can be filtered. Filter can also be used to cancel a canonical redirect by returning false.
     440         *
     441         * @since 2.3.0
     442         *
     443         * @param string $redirect_url The url that the user will be redirected to.
     444         * @param string $requested_url The url that is requested and the redirect will be performed upon.
     445         */
    436446        $redirect_url = apply_filters('redirect_canonical', $redirect_url, $requested_url);
    437447
    438448        if ( !$redirect_url || $redirect_url == $requested_url ) // yes, again -- in case the filter aborted the request