Automattic\WooCommerce\Blocks\Domain\Services
CheckoutFields::get_field_type
Returns the field type handling a field, falling back to text for core and unknown types.
Method of the class: CheckoutFields{}
No Hooks.
Returns
AbstractFieldType.
Usage
// private - for code of main (parent) class only $result = $this->get_field_type( $field ): AbstractFieldType;
- $field(array) (required)
- The field, or the options supplied during field registration.
CheckoutFields::get_field_type() CheckoutFields::get field type code WC 11.2.2
private function get_field_type( array $field ): AbstractFieldType {
return $this->field_types[ $field['type'] ?? '' ] ?? $this->field_types['text'];
}