WordPress.org

Make WordPress Core

Ticket #17950: 17950.7.diff

File 17950.7.diff, 4.2 KB (added by SergeyBiryukov, 5 years ago)

With phpdoc corrections

  • wp-includes/general-template.php

     
    199199/**
    200200 * Returns the Log Out URL.
    201201 *
    202  * Returns the URL that allows the user to log out of the site
     202 * Returns the URL that allows the user to log out of the site.
    203203 *
    204204 * @since 2.7.0
    205  * @uses wp_nonce_url() To protect against CSRF
    206  * @uses site_url() To generate the log in URL
    207  * @uses apply_filters() calls 'logout_url' hook on final logout url
     205 * @uses wp_nonce_url() To protect against CSRF.
     206 * @uses site_url() To generate the log out URL.
     207 * @uses apply_filters() calls 'logout_url' hook on final logout URL.
    208208 *
    209209 * @param string $redirect Path to redirect to on logout.
    210210 * @return string A log out URL.
     
    224224/**
    225225 * Returns the Log In URL.
    226226 *
    227  * Returns the URL that allows the user to log in to the site
     227 * Returns the URL that allows the user to log in to the site.
    228228 *
    229229 * @since 2.7.0
    230  * @uses site_url() To generate the log in URL
    231  * @uses apply_filters() calls 'login_url' hook on final login url
     230 * @uses site_url() To generate the log in URL.
     231 * @uses apply_filters() calls 'login_url' hook on final login URL.
    232232 *
    233233 * @param string $redirect Path to redirect to on login.
    234234 * @param bool $force_reauth Whether to force reauthorization, even if a cookie is present. Default is false.
     
    247247}
    248248
    249249/**
     250 * Returns the user registration URL.
     251 *
     252 * Returns the URL that allows the user to register on the site.
     253 *
     254 * @since 3.6.0
     255 * @uses site_url() To generate the registration URL.
     256 * @uses apply_filters() calls 'register_url' hook on final URL.
     257 *
     258 * @return string
     259 */
     260function wp_registration_url() {
     261        return apply_filters( 'register_url', site_url( 'wp-login.php?action=register', 'login' ) );
     262}
     263
     264/**
    250265 * Provides a simple login form for use anywhere within WordPress. By default, it echoes
    251266 * the HTML immediately. Pass array('echo'=>false) to return the string instead.
    252267 *
     
    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
     
    703703<p id="nav">
    704704<?php if ( ! isset( $_GET['checkemail'] ) || ! in_array( $_GET['checkemail'], array( 'confirm', 'newpass' ) ) ) : ?>
    705705        <?php if ( get_option( 'users_can_register' ) ) : ?>
    706                 <?php echo apply_filters( 'register', sprintf( '<a href="%s">%s</a>', esc_url( site_url( 'wp-login.php?action=register', 'login' ) ), __( 'Register' ) ) ); ?> |
     706                <?php echo apply_filters( 'register', sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) ) ); ?> |
    707707        <?php endif; ?>
    708708        <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>" title="<?php esc_attr_e( 'Password Lost and Found' ); ?>"><?php _e( 'Lost your password?' ); ?></a>
    709709<?php endif; ?>