Description
This action hook fires during submission, allowing you to perform custom actions before the confirmation is processed.
Usage
add_action( 'gform_pre_handle_confirmation', 'custom_function', 10, 2 );
You can also specify this per form by adding the form id after the hook name.
add_action( 'gform_pre_handle_confirmation_6', 'custom_function', 10, 2 );
Parameters
$entry Entry Object
The current entry.- $form Form Object
The current form.
Examples
add_action( 'gform_pre_handle_confirmation', function ( $entry, $form ) {
// Do your stuff here.
}, 10, 2 );
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?
Source Code
This filter is located in GFFormDisplay::handle_submission() in form_display.php.