Back to list of all filter and action hooks for EU-VAT Assistant.
Description #
Customize the appearance, behavior, and validation arguments of the default VAT number field in the checkout and address forms.
Parameters #
$args
(array) The field arguments array that defines the VAT number field properties.
The array of field arguments used to define the VAT number field, any argument accepted by WooCommerce checkout fields can be used, most commonly:
label
(string) The field label, usually displayed above the input field.description
(string|null) The description of the field, usually used to display help text below the input field. Set tonull
to remove it.required
(boolean) Whether the field is mandatory.class
(array) Additional CSS classes applied to the field container.priority
(integer) Field display order priority in the form (lower = earlier).optional_expand_link_lowercase
(boolean) Controls whether the links to expand/collapse this field are displayed in lowercase or normal letter case. Only applies if the field is optional. Defaults to `false`, normal letter case.
Examples #
/**
* Customize VAT number field
*/
function fc_vat_customize_number_field_args_callback( $args ) {
// Change field label
$args['label'] = __( 'Tax ID Number', 'your-text-domain' );
// Change field description
$args['description'] = 'Enter your business tax identification number';
// Change field priority (display order in form)
$args['priority'] = 100;
// Add custom CSS classes
$args['class'][] = 'custom-vat-field';
// Make field required
$args['required'] = true;
return $args;
}
add_filter( 'fc_vat_number_field_args', 'fc_vat_customize_number_field_args_callback', 10 );