gform_post_process

gform_post_process

DescriptionUsageParametersExamplesPlacementSource Code

Description
This action fires after the form processing is completed, allowing further actions to be performed. Form processing happens when submitting a page on a multi-page form (i.e. going to the 「Next」 or 「Previous」 page), or when submitting a single page form.
Usage
The following would apply to all forms:
add_action( 'gform_post_process', 'your_function_name', 10, 3 );

To target a specific form, append the form id to the hook name. (format: gform_post_process_FORMID)
add_action( 'gform_post_process_1', 'your_function_name', 10, 3 );

Parameters

$form Form Object
The form object.

$page_number int
In a multi-page form, this variable contains the current page number.

$source_page_number int
In a multi-page form, this parameter contains the number of the page from which the submission came.

Examples
add_action( 'gform_post_process', 'post_process_actions', 10, 3 );
function post_process_actions( $form, $page_number, $source_page_number ){
//do something
if ( $page_number >= 1 ){
echo 'multi-page';
}
}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GFFormDisplay::process_form() in form_display.php.

發表回覆

您的郵箱地址不會被公開。 必填項已用 * 標註