fluentform_before_insert_submission

Description #

This action fires after the submission validation is completed and just before insert submission data to the database. If you want to do extra validation of the submitted data then you can catch this action hook and do your staff.

/*
* Source Action
*/
do_action('fluentform_before_insert_submission', $insertData, $data, $form);

Usage #

The following would apply to all forms:

add_action('fluentform_before_insert_submission', 'your_custom_before_submission_function', 10, 3);

function your_custom_before_submission_function($insertData, $data, $form)
{
   // DO your stuffs here
}

The following would apply to a specific form id: 5:

add_action('fluentform_before_insert_submission', 'your_custom_before_submission_function', 10, 3);

function your_custom_before_submission_function($insertData, $data, $form)
{
   if($form->id != 5) {
      return;
   }

   // DO your stuffs here
}

Parameters #

  • $data (array) $_POST[‘data’] from submission

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

Powered by BetterDocs