public function update( $args, $assoc_args ) {
		if ( isset( $assoc_args['user_login'] ) ) {
			WP_CLI::warning( "User logins can't be changed." );
			unset( $assoc_args['user_login'] );
		}

		$user_ids = [];
		foreach ( $this->fetcher->get_many( $args ) as $user ) {
			$user_ids[] = $user->ID;
		}

		$skip_email = Utils\get_flag_value( $assoc_args, 'skip-email' );
		if ( $skip_email ) {
			add_filter( 'send_email_change_email', '__return_false' );
			add_filter( 'send_password_change_email', '__return_false' );
		}

		$assoc_args = wp_slash( $assoc_args );
		parent::_update( $user_ids, $assoc_args, 'wp_update_user' );

		if ( $skip_email ) {
			remove_filter( 'send_email_change_email', '__return_false' );
			remove_filter( 'send_password_change_email', '__return_false' );
		}
	}
public function update( $args, $assoc_args ) {
		if ( isset( $assoc_args['user_login'] ) ) {
			WP_CLI::warning( "User logins can't be changed." );
			unset( $assoc_args['user_login'] );
		}

		$user_ids = [];
		foreach ( $this->fetcher->get_many( $args ) as $user ) {
			$user_ids[] = $user->ID;
		}

		$skip_email = Utils\get_flag_value( $assoc_args, 'skip-email' );
		if ( $skip_email ) {
			add_filter( 'send_email_change_email', '__return_false' );
			add_filter( 'send_password_change_email', '__return_false' );
		}

		$assoc_args = wp_slash( $assoc_args );
		parent::_update( $user_ids, $assoc_args, 'wp_update_user' );

		if ( $skip_email ) {
			remove_filter( 'send_email_change_email', '__return_false' );
			remove_filter( 'send_password_change_email', '__return_false' );
		}
	}
public function update ( $ args , $ assoc_args ) { if ( isset ( $ assoc_args [ 'user_login' ] ) ) { WP_CLI :: warning ( "User logins can't be changed." ) ; unset ( $ assoc_args [ 'user_login' ] ) ; } $ user_ids = [ ] ; foreach ( $ this -> fetcher -> get_many ( $ args ) as $ user ) { $ user_ids [ ] = $ user -> ID ; } $ skip_email = Utils \ get_flag_value ( $ assoc_args , 'skip-email' ) ; if ( $ skip_email ) { add_filter ( 'send_email_change_email' , '__return_false' ) ; add_filter ( 'send_password_change_email' , '__return_false' ) ; } $ assoc_args = wp_slash ( $ assoc_args ) ; parent :: _update ( $ user_ids , $ assoc_args , 'wp_update_user' ) ; if ( $ skip_email ) { remove_filter ( 'send_email_change_email' , '__return_false' ) ; remove_filter ( 'send_password_change_email' , '__return_false' ) ; } }
Updates an existing user.

## OPTIONS

<user>...
: The user login, user email or user ID of the user(s) to update.

[--user_pass=<password>]
: A string that contains the plain text password for the user.

[--user_nicename=<nice_name>]
: A string that contains a URL-friendly name for the user. The default is the user's username.

[--user_url=<url>]
: A string containing the user's URL for the user's web site.

[--user_email=<email>]
: A string containing the user's email address.

[--display_name=<display_name>]
: A string that will be shown on the site. Defaults to user's username.

[--nickname=<nickname>]
: The user's nickname, defaults to the user's username.

[--first_name=<first_name>]
: The user's first name.

[--last_name=<last_name>]
: The user's last name.

[--description=<description>]
: A string containing content about the user.

[--rich_editing=<rich_editing>]
: A string for whether to enable the rich editor or not. False if not empty.

[--user_registered=<yyyy-mm-dd-hh-ii-ss>]
: The date the user registered.

[--role=<role>]
: A string used to set the user's role.

--<field>=<value>
: One or more fields to update. For accepted fields, see wp_update_user().

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

## EXAMPLES

# Update user
$ wp user update 123 --display_name=Mary --user_pass=marypass
Success: Updated user 123.
Updates an existing user .