fluentform_submission_confirmation

Description  #

This filter is available just before sending the success message to client. You can use this filter hook to alter form confirmation dynamically.

apply_filters('fluentform_submission_confirmation', $returnData, $form, $confirmation );

Usage   #

The following would apply to all forms:

add_filter('fluentform_submission_confirmation', 'custom_code_before_confirmation_msg_function', 10, 3);

function custom_code_before_confirmation_msg_function($returnData, $form, $confirmation )
{
   // DO your stuffs here
   return $returnData;
}

The following would apply to a specific form id 5:

add_filter('fluentform_submission_confirmation', 'custom_code_before_confirmation_msg_function', 10, 3);

function custom_code_before_confirmation_msg_function($returnData, $form, $confirmation )
{
   if($formId != 5) {
      return;
   }

   // DO your stuffs here
   return $returnData;
}

Parameters  #

  • $returnData (array)
$returnData = [
   'message' => $message, 
   'action'  => $confirmation['samePageFormBehavior'], //it can be  'customUrl' or 'samePageFormBehavior'
];
$confirmation = [
    [redirectTo] => customUrl, // redirect type (it can be samePage or customUrl) 
    [messageToShow] => 'Thank you for your message. We will get in touch with you shortly', // Confirmation message before redirect
    [customPage] => 4131,
    [samePageFormBehavior] => hide_form, //if there is no redirect page given, it will hide the form after submision
    [customUrl] => 'http://localhost/sandbox/wp-admin', //url of the page where the form will be redirect to
    [redirectMessage] => '<p>Some text</p>', //Some text after redirect
 ];

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

Powered by BetterDocs