Automattic\WooCommerce\Blocks\Domain\Services
CheckoutFields::prepare_form_field
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.
Метод класса: CheckoutFields{}
Хуков нет.
Возвращает
array. The updated arguments.
Использование
$CheckoutFields = new CheckoutFields(); $CheckoutFields->prepare_form_field( $form_field ): array;
- $form_field(массив) (обязательный)
- The woocommerce_form_field() arguments built from the field.
Код CheckoutFields::prepare_form_field() CheckoutFields::prepare form field WC 11.3.0
public function prepare_form_field( array $form_field ): array {
return $this->get_field_type( $form_field )->prepare_form_field( $form_field );
}