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 #
- $insertData (array) submission_data Array
- $data (array) $_POST[‘data’] Form Submission
- $form (Object) The $form Object
Placement #
This code should be placed in the functions.php file of your active theme.
Source Code #
This action is located in fluentform/app/Services/Form/SubmissionHandlerService.php