WC_Shortcode_My_Account::reset_password()public staticWC 1.0

Handles resetting the user's password.

Method of the class: WC_Shortcode_My_Account{}

Return

null. Nothing (null).

Usage

$result = WC_Shortcode_My_Account::reset_password( $user, $new_pass );
$user(object) (required)
The user.
$new_pass(string) (required)
New password for the user in plaintext.

WC_Shortcode_My_Account::reset_password() code WC 9.4.2

public static function reset_password( $user, $new_pass ) {
	do_action( 'password_reset', $user, $new_pass );

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

	if ( ! apply_filters( 'woocommerce_disable_password_change_notification', false ) ) {
		wp_password_change_notification( $user );
	}
}