public function reset_password( $args, $assoc_args ) {
		$skip_email = Utils\get_flag_value( $assoc_args, 'skip-email' );
		if ( $skip_email ) {
			add_filter( 'send_password_change_email', '__return_false' );
		}
		$fetcher = new UserFetcher();
		$users   = $fetcher->get_many( $args );
		foreach ( $users as $user ) {
			wp_update_user(
				[
					'ID'        => $user->ID,
					'user_pass' => wp_generate_password(),
				]
			);
			WP_CLI::log( "Reset password for {$user->user_login}." );
		}
		if ( $skip_email ) {
			remove_filter( 'send_password_change_email', '__return_false' );
		}
		WP_CLI::success( count( $users ) > 1 ? 'Passwords reset.' : 'Password reset.' );
	}
public function reset_password( $args, $assoc_args ) {
		$skip_email = Utils\get_flag_value( $assoc_args, 'skip-email' );
		if ( $skip_email ) {
			add_filter( 'send_password_change_email', '__return_false' );
		}
		$fetcher = new UserFetcher();
		$users   = $fetcher->get_many( $args );
		foreach ( $users as $user ) {
			wp_update_user(
				[
					'ID'        => $user->ID,
					'user_pass' => wp_generate_password(),
				]
			);
			WP_CLI::log( "Reset password for {$user->user_login}." );
		}
		if ( $skip_email ) {
			remove_filter( 'send_password_change_email', '__return_false' );
		}
		WP_CLI::success( count( $users ) > 1 ? 'Passwords reset.' : 'Password reset.' );
	}
public function reset_password ( $ args , $ assoc_args ) { $ skip_email = Utils \ get_flag_value ( $ assoc_args , 'skip-email' ) ; if ( $ skip_email ) { add_filter ( 'send_password_change_email' , '__return_false' ) ; } $ fetcher = new UserFetcher ( ) ; $ users = $ fetcher -> get_many ( $ args ) ; foreach ( $ users as $ user ) { wp_update_user ( [ 'ID' => $ user -> ID , 'user_pass' => wp_generate_password ( ) , ] ) ; WP_CLI :: log ( "Reset password for {$user->user_login}." ) ; } if ( $ skip_email ) { remove_filter ( 'send_password_change_email' , '__return_false' ) ; } WP_CLI :: success ( count ( $ users ) > 1 ? 'Passwords reset.' : 'Password reset.' ) ; }
Resets the password for one or more users.

## OPTIONS

<user>...
: one or more user logins or IDs.

[--skip-email]
: Don't send an email notification to the affected user(s).

## EXAMPLES

# Reset the password for two users and send them the change email.
$ wp user reset-password admin editor
Reset password for admin.
Reset password for editor.
Success: Passwords reset.

@subcommand reset-password
Resets the password for one or more users .