WordPress.org

Make WordPress Core

Ticket #17950: 17950.5.diff

File 17950.5.diff, 2.2 KB (added by JustinSainton, 5 years ago)
  • wp-includes/general-template.php

     
    195195        else
    196196                return apply_filters('loginout', $link);
    197197}
     198/**
     199 * Returns the user registration URL
     200 *
     201 * Returns the URL that allows the user to log in to the site
     202 *
     203 * @since 3.6.0
     204 * @uses site_url() To generate the log in URL
     205 * @uses apply_filters() calls 'register_url' hook on final url
     206 *
     207 * @return string
     208 */
     209function wp_registration_url() {
     210        return apply_filters( 'register_url', site_url( 'wp-login.php?action=register', 'login' ) );
     211}
    198212
     213
    199214/**
    200215 * Returns the Log Out URL.
    201216 *
     
    338353
    339354        if ( ! is_user_logged_in() ) {
    340355                if ( get_option('users_can_register') )
    341                         $link = $before . '<a href="' . site_url('wp-login.php?action=register', 'login') . '">' . __('Register') . '</a>' . $after;
     356                        $link = $before . '<a href="' . esc_url( wp_registration_url() ) . '">' . __('Register') . '</a>' . $after;
    342357                else
    343358                        $link = '';
    344359        } else {
  • wp-login.php

     
    451451<p id="nav">
    452452<a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e('Log in') ?></a>
    453453<?php if ( get_option( 'users_can_register' ) ) : ?>
    454  | <?php echo apply_filters( 'register', sprintf( '<a href="%s">%s</a>', esc_url( site_url( 'wp-login.php?action=register', 'login' ) ), __( 'Register' ) ) ); ?>
     454 | <?php echo apply_filters( 'register', sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) ) ); ?>
    455455<?php endif; ?>
    456456</p>
    457457
     
    510510<p id="nav">
    511511<a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a>
    512512<?php if ( get_option( 'users_can_register' ) ) : ?>
    513  | <?php echo apply_filters( 'register', sprintf( '<a href="%s">%s</a>', esc_url( site_url( 'wp-login.php?action=register', 'login' ) ), __( 'Register' ) ) ); ?>
     513 | <?php echo apply_filters( 'register', sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) ) ); ?>
    514514<?php endif; ?>
    515515</p>
    516516