Automattic\WooCommerce\Blocks\Domain\Services

CheckoutFields::process_field_optionsprivateWC 1.0

Processes the options for a field type and returns the new field_options array.

Method of the class: CheckoutFields{}

No Hooks.

Returns

Array. The updated $field_data array.

Usage

// private - for code of main (parent) class only
$result = $this->process_field_options( $field_data, $options );
$field_data(array) (required)
The field data array to be updated.
$options(array) (required)
The options supplied during field registration.

CheckoutFields::process_field_options() code WC 9.9.4

private function process_field_options( $field_data, $options ) {
	if ( 'checkbox' === $field_data['type'] ) {
		$field_data = $this->process_checkbox_field( $field_data, $options );
	} elseif ( 'select' === $field_data['type'] ) {
		$field_data = $this->process_select_field( $field_data, $options );
	}
	return $field_data;
}