reset_password() – Handles resetting the user’s password.

You appear to be a bot. Output may be restricted

Description

Handles resetting the user's password.

Usage

reset_password( $user, $new_pass );

Parameters

$user
( WP_User ) required – The user
$new_pass
( string ) required – New password for the user in plaintext

Returns

void

Source

File name: wordpress/wp-includes/user.php
Lines:

1 to 24 of 24
function reset_password( $user, $new_pass ) {
  
/**
 * Fires before the user's password is reset.
 *
 * @since 1.5.0
 *
 * @param WP_User $user     The user.
 * @param string  $new_pass New user password.
 */
  do_action( 'password_reset', $user, $new_pass );

  wp_set_password( $new_pass, $user->ID );
  update_user_meta( $user->ID, 'default_password_nag', false );

  
/**
 * Fires after the user's password is reset.
 *
 * @since 4.4.0
 *
 * @param WP_User $user     The user.
 * @param string  $new_pass New user password.
 */
  do_action( 'after_password_reset', $user, $new_pass );
}
 

 View on GitHub View on Trac