Skip to content

Commit

Permalink
feat: update wp_set_password function to match current wordpress ve…
Browse files Browse the repository at this point in the history
…rsion

fixes #18
  • Loading branch information
carlalexander committed Nov 25, 2024
1 parent 109e3be commit 0f125a0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pluggable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 0f125a0

Please sign in to comment.