Automattic\WooCommerce\Blocks\Domain\Services

CheckoutFields::persist_field_for_customerpublicWC 1.0

Persists a field value for a given customer.

Метод класса: CheckoutFields{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$CheckoutFields = new CheckoutFields();
$CheckoutFields->persist_field_for_customer( $key, $value, $customer, $group );
$key(строка) (обязательный)
The field key.
$value(разное) (обязательный)
The field value.
$customer(WC_Customer) (обязательный)
The customer to persist the field for.
$group(строка)
The group to persist the field for (shipping|billing|other).
По умолчанию: 'other'

Код CheckoutFields::persist_field_for_customer() WC 10.3.4

public function persist_field_for_customer( string $key, $value, WC_Customer $customer, string $group = 'other' ) {
	$group = $this->prepare_group_name( $group );
	$this->set_array_meta( $key, $value, $customer, $group );
}