Automattic\WooCommerce\Internal\Orders
OrderAttributionController::set_customer_source_data
Save source data for a Customer object.
Метод класса: OrderAttributionController{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// private - только в коде основоного (родительского) класса $result = $this->set_customer_source_data( $customer );
- $customer(WC_Customer) (обязательный)
- The customer object.
Код OrderAttributionController::set_customer_source_data() OrderAttributionController::set customer source data WC 10.7.0
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();
}