WordPress.org

Make WordPress Core

Ticket #18743: general-template.php.patch

File general-template.php.patch, 910 bytes (added by ross_ritchey, 4 years ago)

Add redirect handling to wp_registration_url

  • src/wp-includes/general-template.php

     
    357357 *
    358358 * @return string User registration URL.
    359359 */
    360 function wp_registration_url() {
     360function wp_registration_url($redirect = '') {
     361        $args = array( 'action' => 'register' );
     362        if ( !empty($redirect) ) {
     363                $args['redirect_to'] = urlencode( $redirect );
     364        }
     365
     366        $registration_url = add_query_arg($args, site_url('wp-login.php', 'login'));
     367
    361368        /**
    362369         * Filters the user registration URL.
    363370         *
     
    365372         *
    366373         * @param string $register The user registration URL.
    367374         */
    368         return apply_filters( 'register_url', site_url( 'wp-login.php?action=register', 'login' ) );
     375        return apply_filters( 'register_url', $registration_url, $redirect );
    369376}
    370377
    371378/**