fluentform_insert_response_data

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 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 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\Modules\Form -> prepareInsertData() in app/Modules/Form/FormHandler.php

Powered by BetterDocs