diff --git a/src/wp-admin/users.php b/src/wp-admin/users.php
index 2c635c543a..bcde4c6735 100644
a
|
b
|
switch ( $wp_list_table->current_action() ) { |
255 | 255 | } |
256 | 256 | |
257 | 257 | // Send the password reset link. |
258 | | $user = get_userdata( $id ); |
259 | | if ( retrieve_password( $user->user_login ) ) { |
| 258 | $user = get_userdata( $id ); |
| 259 | $retrieve_password = retrieve_password( $user->user_login ); |
| 260 | if ( is_wp_error( $retrieve_password ) ) { |
| 261 | $redirect = add_query_arg( |
| 262 | array( |
| 263 | 'reset_count' => $reset_count, |
| 264 | 'update' => 'resetpassword', |
| 265 | 'error' => 1, |
| 266 | ), |
| 267 | $redirect |
| 268 | ); |
| 269 | wp_redirect( $redirect ); |
| 270 | exit; |
| 271 | } else { |
260 | 272 | ++$reset_count; |
261 | 273 | } |
262 | 274 | } |
… |
… |
switch ( $wp_list_table->current_action() ) { |
633 | 645 | $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . $message . '</p></div>'; |
634 | 646 | break; |
635 | 647 | case 'resetpassword': |
636 | | $reset_count = isset( $_GET['reset_count'] ) ? (int) $_GET['reset_count'] : 0; |
637 | | if ( 1 === $reset_count ) { |
| 648 | $reset_count = isset( $_GET['reset_count'] ) ? (int) $_GET['reset_count'] : 0; |
| 649 | $reset_pass_error = isset( $_GET['error'] ) ? (int) $_GET['error'] : 0; |
| 650 | if ( 0 === $reset_count && 1 === $reset_pass_error ) { |
| 651 | $message = sprintf( |
| 652 | /* translators: %s: Documentation URL. */ |
| 653 | __( '<strong>Error:</strong> The email could not be sent. Your site may not be correctly configured to send emails. <a href="%s">Get support for resetting your password</a>.' ), |
| 654 | esc_url( __( 'https://wordpress.org/documentation/article/reset-your-password/' ) ) |
| 655 | ); |
| 656 | } elseif ( 1 === $reset_count ) { |
638 | 657 | $message = __( 'Password reset link sent.' ); |
639 | 658 | } else { |
640 | 659 | /* translators: %s: Number of users. */ |