Automattic\WooCommerce\Blocks\Domain\Services

CheckoutFields::get_field_type │ private │ WC 1.0

Returns the field type handling a field, falling back to text for core and unknown types.

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

Хуков нет.

Возвращает

AbstractFieldType.

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

// private - только в коде основоного (родительского) класса
$result = $this->get_field_type( $field ): AbstractFieldType;
$field(массив) (обязательный)
The field, or the options supplied during field registration.

Код CheckoutFields::get_field_type() WC 11.3.0

private function get_field_type( array $field ): AbstractFieldType {
	return $this->field_types[ $field['type'] ?? '' ] ?? $this->field_types['text'];
}