Automattic\WooCommerce\Blocks\Domain\Services
CheckoutFields::update_default_locale_with_fields()
Update the default locale with additional fields without country limitations.
Method of the class: CheckoutFields{}
No Hooks.
Return
Mixed
.
Usage
$CheckoutFields = new CheckoutFields(); $CheckoutFields->update_default_locale_with_fields( $locale );
- $locale(array) (required)
- The locale to update.
CheckoutFields::update_default_locale_with_fields() CheckoutFields::update default locale with fields code WC 9.7.1
public function update_default_locale_with_fields( $locale ) { foreach ( $this->get_fields_for_location( 'address' ) as $field_id => $additional_field ) { if ( empty( $locale[ $field_id ] ) ) { $locale[ $field_id ] = $additional_field; } } return $locale; }