diff --git a/pluggable.php b/pluggable.php index 83ae331..4063c5b 100644 --- a/pluggable.php +++ b/pluggable.php @@ -92,10 +92,15 @@ function wp_set_password($password, $user_id) { global $wpdb; + $old_user_data = get_userdata($user_id); + $hash = wp_hash_password($password); + $wpdb->update($wpdb->users, array('user_pass' => $hash, 'user_activation_key' => ''), array('ID' => $user_id)); - wp_cache_delete($user_id, 'users'); + clean_user_cache($user_id); + + do_action('wp_set_password', $password, $user_id, $old_user_data); return $hash; }