Skip to content
Snippets Groups Projects
Commit 2a8061ed authored by Lucas García's avatar Lucas García
Browse files

feat: try int casting on wpcf7 hidden fields

parent 70c8af7d
No related branches found
No related tags found
No related merge requests found
......@@ -88,11 +88,13 @@ class Integration extends BaseIntegration
$i = array_search($key, array_column($form_data['fields'], 'name'));
$field = $form_data['fields'][$i];
if ($field['type'] === 'number') {
$number = (float) $val;
if ((string) $number === $val) {
$data[$key] = $number;
if ($field['type'] === 'hidden') {
$number_val = (float) $val;
if ((string) $number_val === $val) {
$data[$key] = $number_val;
}
} elseif ($field['type'] === 'number') {
$data[$key] = (float) $val;
} elseif ($field['type'] === 'file' || $field['type'] === 'submit') {
unset($data[$key]);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment