formcierge_normalize_field
Filter
Since v1.0.0
Normalize a field definition array before it is stored or processed. Use to set defaults, enforce constraints, or add computed properties.
Parameters
$field
array
The field definition array.
$form_id
int
The form ID.
includes/Core/FormValidator.php
Basic Usage
add_filter( 'formcierge_normalize_field', function ( $field, $form_id ) {
if ( $field['type'] === 'tel' ) {
$field['required'] = false;
}
return $field;
}, 10, 2 );