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 d908719
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions 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;

$hash = wp_hash_password($password);
$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 d908719

Please sign in to comment.