WordPress at Your Fingertips
function is not described

WC_Customer_Data_Store::update() public WC 3.0.0

Updates a customer in the database.

{} It's a method of the class: WC_Customer_Data_Store{}

Return

null. Nothing.

Usage

$WC_Customer_Data_Store = new WC_Customer_Data_Store();
$WC_Customer_Data_Store->update( $customer );
$customer(WC_Customer) (required) (passed by reference — &)
Customer object.

Changelog

Since 3.0.0 Introduced.

Code of WC_Customer_Data_Store::update() WC 5.8.0

public function update( &$customer ) {
	wp_update_user(
		apply_filters(
			'woocommerce_update_customer_args',
			array(
				'ID'           => $customer->get_id(),
				'user_email'   => $customer->get_email(),
				'display_name' => $customer->get_display_name(),
			),
			$customer
		)
	);

	// Only update password if a new one was set with set_password.
	if ( $customer->get_password() ) {
		wp_update_user(
			array(
				'ID'        => $customer->get_id(),
				'user_pass' => $customer->get_password(),
			)
		);
		$customer->set_password( '' );
	}

	$this->update_user_meta( $customer );
	$customer->set_date_modified( get_user_meta( $customer->get_id(), 'last_update', true ) );
	$customer->save_meta_data();
	$customer->apply_changes();
	do_action( 'woocommerce_update_customer', $customer->get_id(), $customer );
}