Automattic\WooCommerce\Internal\Orders
OrderAttributionController::set_customer_source_data
Save source data for a Customer object.
Method of the class: OrderAttributionController{}
No Hooks.
Returns
null. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->set_customer_source_data( $customer );
- $customer(WC_Customer) (required)
- The customer object.
OrderAttributionController::set_customer_source_data() OrderAttributionController::set customer source data code WC 10.3.6
private function set_customer_source_data( WC_Customer $customer ) {
// Nonce check is handled before user_register hook.
// phpcs:ignore WordPress.Security.NonceVerification
foreach ( $this->get_source_values( $this->get_unprefixed_field_values( $_POST ) ) as $key => $value ) {
$customer->add_meta_data( $this->get_meta_prefixed_field_name( $key ), $value );
}
$customer->save_meta_data();
}