Description #
If you want to alter/format the submitted data you can use this filter. The returned data will be inserted into the submission as a response.
apply_filters('fluentform/insert_response_data', $formData, $formId, $inputConfigs);
Usage #
The following would apply to all forms:
add_filter('fluentform/insert_response_data', 'your_custom_response_data_filter_function', 10, 3);
function your_custom_response_data_filter_function($formData, $formId, $inputConfigs)
{
// Your can alter the data here
return $formData;
}
The following would apply to a specific form id 5:
add_filter('fluentform/insert_response_data', 'your_custom_response_data_filter_function', 10, 3);
function your_custom_response_data_filter_function($formData, $formId, $inputConfigs)
{
if($formId != 5) {
return $formData;
}
// Your can alter the data here
return $formData;
}
Parameters #
- $formData (array) Entry Response as key-value pair where input name as array key and each response as value.
- $formId int Form ID
- $inputConfigs (array) This contains the full-form inputs fields as a 2-dimensional array
Placement #
This code should be placed in the functions.php file of your active theme.
Source Code #
This filter is located in FluentForm\App\Services\Form\SubmissionHandlerService -> prepareInsertData()