Use wp_lostpassword_url() instead of site_url(wp-login...). Update wp_lostpassword_url() to use network_site_url(). props markoheijnen, fixes #18808.
git-svn-id: http://svn.automattic.com/wordpress/trunk@19027 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -288,14 +288,14 @@ function wp_login_form( $args = array() ) {
|
||||
*
|
||||
* @param string $redirect Path to redirect to on login.
|
||||
*/
|
||||
function wp_lostpassword_url($redirect = '') {
|
||||
function wp_lostpassword_url( $redirect = '' ) {
|
||||
$args = array( 'action' => 'lostpassword' );
|
||||
if ( !empty($redirect) ) {
|
||||
$args['redirect_to'] = $redirect;
|
||||
}
|
||||
|
||||
$lostpassword_url = add_query_arg($args, site_url('wp-login.php', 'login'));
|
||||
return apply_filters('lostpassword_url', $lostpassword_url, $redirect);
|
||||
$lostpassword_url = add_query_arg( $args, network_site_url('wp-login.php', 'login') );
|
||||
return apply_filters( 'lostpassword_url', $lostpassword_url, $redirect );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -88,7 +88,7 @@ function wp_authenticate_username_password($user, $username, $password) {
|
||||
$userdata = get_user_by('login', $username);
|
||||
|
||||
if ( !$userdata )
|
||||
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')));
|
||||
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()));
|
||||
|
||||
if ( is_multisite() ) {
|
||||
// Is user marked as spam?
|
||||
@@ -109,7 +109,7 @@ function wp_authenticate_username_password($user, $username, $password) {
|
||||
|
||||
if ( !wp_check_password($password, $userdata->user_pass, $userdata->ID) )
|
||||
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>?' ),
|
||||
$username, site_url( 'wp-login.php?action=lostpassword', 'login' ) ) );
|
||||
$username, wp_lostpassword_url() ) );
|
||||
|
||||
$user = new WP_User($userdata->ID);
|
||||
return $user;
|
||||
|
||||
Reference in New Issue
Block a user