CheckoutFields::persist_field_for_customer()publicWC 1.0

Persists a field value for a given customer.

Method of the class: CheckoutFields{}

No Hooks.


null. Nothing (null).


$CheckoutFields = new CheckoutFields();
$CheckoutFields->persist_field_for_customer( $key, $value, $customer, $group );
$key(string) (required)
The field key.
$value(mixed) (required)
The field value.
$customer(WC_Customer) (required)
The customer to persist the field for.
The group to persist the field for (shipping|billing|other).
Default: 'other'

CheckoutFields::persist_field_for_customer() code WC 9.0.1

public function persist_field_for_customer( string $key, $value, WC_Customer $customer, string $group = 'other' ) {
	if ( 'additional' === $group ) {
		wc_deprecated_argument( 'group', '8.9.0', 'The "additional" group is deprecated. Use "other" instead.' );
		$group = 'other';

	$this->set_array_meta( $key, $value, $customer, $group );