gform_incomplete_submission_post_get

gform_incomplete_submission_post_get

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
Allows the draft submission for Save and Continue to be overridden after it is retrieved from the database but before it used to populate the form.
Usage
1add_filter( 'gform_incomplete_submission_post_get', 'your_function_name', 10, 3 );

Parameters

$submission_json array
JSON encoded associative array containing the incomplete submission. The following is found in the array:
123456*    @type array      $submitted_values The submitted values.*    @type array      $partial_entry    The draft entry created from the submitted values.*    @type null|array $field_values     The dynamic population field values.*    @type int        $page_number      The forms current page number.*    @type array      $files            The uploaded file properties.*    @type string     $gform_unique_id  The unique id for this submission.

$resume_token string
The unique token which can be used to resume the incomplete submission at a later date/time.

$form Form Object
The form object.

Examples
12345678add_filter( 'gform_incomplete_submission_post_get', 'modify_incomplete_submission_after', 10, 3 );function modify_incomplete_submission_after( $submission_json, $resume_token, $form){    //change the user first name to Test in the saved data    $updated_json = json_decode( $submission_json );    $updated_json->submitted_values->{'1'}->{'1.3'} = 'Test';    $submission_json = json_encode($updated_json);    return $submission_json;}
Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms 2.3.4.
Source Code
This filter is located in GFFormsModel::filter_draft_submission_post_get() in forms_model.php.

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注