Ticket #17950: 17950.7.diff
| File 17950.7.diff, 4.2 KB (added by , 13 years ago) |
|---|
-
wp-includes/general-template.php
199 199 /** 200 200 * Returns the Log Out URL. 201 201 * 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. 203 203 * 204 204 * @since 2.7.0 205 * @uses wp_nonce_url() To protect against CSRF 206 * @uses site_url() To generate the log in URL207 * @uses apply_filters() calls 'logout_url' hook on final logout url205 * @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. 208 208 * 209 209 * @param string $redirect Path to redirect to on logout. 210 210 * @return string A log out URL. … … 224 224 /** 225 225 * Returns the Log In URL. 226 226 * 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. 228 228 * 229 229 * @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 url230 * @uses site_url() To generate the log in URL. 231 * @uses apply_filters() calls 'login_url' hook on final login URL. 232 232 * 233 233 * @param string $redirect Path to redirect to on login. 234 234 * @param bool $force_reauth Whether to force reauthorization, even if a cookie is present. Default is false. … … 247 247 } 248 248 249 249 /** 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 */ 260 function wp_registration_url() { 261 return apply_filters( 'register_url', site_url( 'wp-login.php?action=register', 'login' ) ); 262 } 263 264 /** 250 265 * Provides a simple login form for use anywhere within WordPress. By default, it echoes 251 266 * the HTML immediately. Pass array('echo'=>false) to return the string instead. 252 267 * … … 338 353 339 354 if ( ! is_user_logged_in() ) { 340 355 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; 342 357 else 343 358 $link = ''; 344 359 } else { -
wp-login.php
451 451 <p id="nav"> 452 452 <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e('Log in') ?></a> 453 453 <?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' ) ) ); ?> 455 455 <?php endif; ?> 456 456 </p> 457 457 … … 510 510 <p id="nav"> 511 511 <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a> 512 512 <?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' ) ) ); ?> 514 514 <?php endif; ?> 515 515 </p> 516 516 … … 703 703 <p id="nav"> 704 704 <?php if ( ! isset( $_GET['checkemail'] ) || ! in_array( $_GET['checkemail'], array( 'confirm', 'newpass' ) ) ) : ?> 705 705 <?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' ) ) ); ?> | 707 707 <?php endif; ?> 708 708 <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>" title="<?php esc_attr_e( 'Password Lost and Found' ); ?>"><?php _e( 'Lost your password?' ); ?></a> 709 709 <?php endif; ?>