WordPress.org

Make WordPress Core

Ticket #18808: 18808-lostpassword2.diff

File 18808-lostpassword2.diff, 6.0 KB (added by markoheijnen, 3 years ago)
  • wp-login.php

     
    530530 
    531531<p id="nav"> 
    532532<a href="<?php echo site_url('wp-login.php', 'login') ?>"><?php _e('Log in') ?></a> | 
    533 <a href="<?php echo site_url('wp-login.php?action=lostpassword', 'login') ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a> 
     533<a href="<?php echo wp_lostpassword_url() ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a> 
    534534</p> 
    535535 
    536536<?php 
     
    659659<?php if ( isset($_GET['checkemail']) && in_array( $_GET['checkemail'], array('confirm', 'newpass') ) ) : ?> 
    660660<?php elseif ( get_option('users_can_register') ) : ?> 
    661661<a href="<?php echo site_url('wp-login.php?action=register', 'login') ?>"><?php _e('Register') ?></a> | 
    662 <a href="<?php echo site_url('wp-login.php?action=lostpassword', 'login') ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a> 
     662<a href="<?php echo wp_lostpassword_url() ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a> 
    663663<?php else : ?> 
    664 <a href="<?php echo site_url('wp-login.php?action=lostpassword', 'login') ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a> 
     664<a href="<?php echo wp_lostpassword_url() ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a> 
    665665<?php endif; ?> 
    666666</p> 
    667667<?php } ?> 
  • wp-includes/user.php

     
    8888        $userdata = get_user_by('login', $username); 
    8989 
    9090        if ( !$userdata ) 
    91                 return new WP_Error('invalid_username', sprintf(__('<strong>ERROR</strong>: Invalid username. <a href="%s" title="Password Lost and Found">Lost your password</a>?'), site_url('wp-login.php?action=lostpassword', 'login'))); 
     91                return new WP_Error('invalid_username', sprintf(__('<strong>ERROR</strong>: Invalid username. <a href="%s" title="Password Lost and Found">Lost your password</a>?'), wp_lostpassword_url())); 
    9292 
    9393        if ( is_multisite() ) { 
    9494                // Is user marked as spam? 
     
    109109 
    110110        if ( !wp_check_password($password, $userdata->user_pass, $userdata->ID) ) 
    111111                return new WP_Error( 'incorrect_password', sprintf( __( '<strong>ERROR</strong>: The password you entered for the username <strong>%1$s</strong> is incorrect. <a href="%2$s" title="Password Lost and Found">Lost your password</a>?' ), 
    112                 $username, site_url( 'wp-login.php?action=lostpassword', 'login' ) ) ); 
     112                $username, wp_lostpassword_url() ) ); 
    113113 
    114114        $user =  new WP_User($userdata->ID); 
    115115        return $user; 
  • wp-includes/general-template.php

     
    288288 * 
    289289 * @param string $redirect Path to redirect to on login. 
    290290 */ 
    291 function wp_lostpassword_url($redirect = '') { 
     291function wp_lostpassword_url( $redirect = '' ) { 
    292292        $args = array( 'action' => 'lostpassword' ); 
    293293        if ( !empty($redirect) ) { 
    294294                $args['redirect_to'] = $redirect; 
    295295        } 
    296296 
    297         $lostpassword_url = add_query_arg($args, site_url('wp-login.php', 'login')); 
    298         return apply_filters('lostpassword_url', $lostpassword_url, $redirect); 
     297        $lostpassword_url = add_query_arg( $args, network_site_url('wp-login.php', 'login') ); 
     298        return apply_filters( 'lostpassword_url', $lostpassword_url, $redirect ); 
    299299} 
    300300 
    301301/** 
  • wp-activate.php

     
    6363                                <?php 
    6464                                echo '<p class="lead-in">'; 
    6565                                if ( $signup->domain . $signup->path == '' ) { 
    66                                         printf( __('Your account has been activated. You may now <a href="%1$s">log in</a> to the site using your chosen username of &#8220;%2$s&#8221;.  Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%4$s">reset your password</a>.'), network_site_url( 'wp-login.php', 'login' ), $signup->user_login, $signup->user_email, network_site_url( 'wp-login.php?action=lostpassword', 'login' ) ); 
     66                                        printf( __('Your account has been activated. You may now <a href="%1$s">log in</a> to the site using your chosen username of &#8220;%2$s&#8221;.  Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%4$s">reset your password</a>.'), network_site_url( 'wp-login.php', 'login' ), $signup->user_login, $signup->user_email, wp_lostpassword_url() ); 
    6767                                } else { 
    68                                         printf( __('Your site at <a href="%1$s">%2$s</a> is active. You may now log in to your site using your chosen username of &#8220;%3$s&#8221;.  Please check your email inbox at %4$s for your password and login instructions.  If you do not receive an email, please check your junk or spam folder.  If you still do not receive an email within an hour, you can <a href="%5$s">reset your password</a>.'), 'http://' . $signup->domain, $signup->domain, $signup->user_login, $signup->user_email, network_site_url( 'wp-login.php?action=lostpassword' ) ); 
     68                                        printf( __('Your site at <a href="%1$s">%2$s</a> is active. You may now log in to your site using your chosen username of &#8220;%3$s&#8221;.  Please check your email inbox at %4$s for your password and login instructions.  If you do not receive an email, please check your junk or spam folder.  If you still do not receive an email within an hour, you can <a href="%5$s">reset your password</a>.'), 'http://' . $signup->domain, $signup->domain, $signup->user_login, $signup->user_email, wp_lostpassword_url() ); 
    6969                                } 
    7070                                echo '</p>'; 
    7171                        } else {