Todavía tenía problemas con la clave de reinicio que no funcionaba correctamente, el enlace en el correo electrónico me redirigiría a la página de reinicio de contraseña estándar con el parámetro de URL que indica un problema con la clave, así que seguí más de cerca el inicio de sesión de wp archivo .php e incluyó el objeto $ wp_hasher, esto solucionó el problema y el restablecimiento de la contraseña en el correo electrónico ahora funciona
if (($_SERVER['REQUEST_METHOD'] === (string) 'POST') && (isset($_POST['reset_pass']))) {
// Acccess global properties
global $wpdb, $wp_hasher;
// Variables
$error_pass_reset = array();
$username = (string) trim($_POST['user_login']);
$user_exists = (bool) false;
// ---- USERNAME OR EMAIL EXISTS ---- //
if (username_exists($username)) {
$user_exists = (bool) true;
$user = (object) get_user_by('login', $username);
} // end if
else if (email_exists($username)) {
$user_exists = (bool) true;
$user = (object) get_user_by('email', $username);
} // end else if
else {
$error_pass_reset[] = '<p>Username or Email was not found, please try again.</p>';
} // end else
// ---- USER EXISTS ---- //
if ($user_exists === (bool) true) {
// Variables
$user_login = (string) $user -> user_login;
$user_email = (string) $user -> user_email;
// Generate password reset key
if (empty($key)) {
$key = (string) wp_generate_password(20, false);
do_action('retrieve_password_key', $user_login, $key);
// Create the $wp_hasher object
if (empty($wp_hasher)) {
require_once(ABSPATH . WPINC . '/class-phpass.php');
$wp_hasher = new PasswordHash(8, true);
}
// Reset key with hasher applied (MD5 has string output)
$hashed = (string) time() . ':' . $wp_hasher -> HashPassword($key);
// Insert the new key into the database
$wpdb -> update(
$wpdb -> users,
array(
'user_activation_key' => $hashed
),
array(
'user_login' => $user_login
)
);
} // end if
// Email message
$message = (string)
'Someone requested that the password be reset for the following account:' . "\r\n\r\n" .
get_option('siteurl') . "\r\n\r\n" .
'Username: ' . $user_login . "\r\n\r\n" .
'If this was a mistake, just ignore this email and nothing will happen.' . "\r\n\r\n" .
'To reset your password, visit the following address:' . "\r\n\r\n" .
get_option('siteurl') . '/wp-login.php?action=rp&key=' . $key . '&login=' . $user_login . "\r\n";
// Send email
if ((bool) false === wp_mail($user_email, get_option('blogname') . ' Password Reset', $message)) {
$error_pass_reset[] = '<p>The e-mail could not be sent at this time.</p>' . "\n";
} // end if
} // end if
// Send the rest password email
do_action('login_form', 'resetpass');
} // end if (($_SERVER['REQUEST_METHOD'] === (string) 'POST') && (isset($_POST['reset_pass'])))