Automattic\WooCommerce\Blocks\Domain\Services

CheckoutFields::prepare_form_field │ public │ WC 1.0

Applies type-specific arguments to a field before it is rendered with woocommerce_form_field().

Used by the server-rendered My Account forms: maps select options, sets checkbox submit values, and resolves date min/max constraints into input attributes.

Method of the class: CheckoutFields{}

No Hooks.

Returns

array. The updated arguments.

Usage

$CheckoutFields = new CheckoutFields();
$CheckoutFields->prepare_form_field( $form_field ): array;
$form_field(array) (required)
The woocommerce_form_field() arguments built from the field.

CheckoutFields::prepare_form_field() code WC 11.2.2

public function prepare_form_field( array $form_field ): array {
	return $this->get_field_type( $form_field )->prepare_form_field( $form_field );
}