Using Gravity Forms ‘gform_incomplete_submission_post_save’ PHP action

The gform_incomplete_submission_post_save action is triggered after an incomplete form submission is saved in Gravity Forms.

Usage

add_action('gform_incomplete_submission_post_save', 'my_function', 10, 4);

Parameters

  • $submission (array): The submission data that was submitted.
  • $resume_token (string): Resume token that is being used for this partial entry.
  • $form (array): Contains an array of information regarding the form.
  • $entry (array): Contains the partial entry that was created.

More information

See Gravity Forms Docs: gform_incomplete_submission_post_save

This action hook is located in forms_model.php.

Examples

Basic usage

function my_function($submission, $resume_token, $form, $entry) {
  // Do something here
}
add_action('gform_incomplete_submission_post_save', 'my_function', 10, 4);

Trigger Mailchimp feed

This example shows how you can trigger the processing of a specific feed when an incomplete submission is saved.

add_action('gform_incomplete_submission_post_save', function ($submission, $resume_token, $form, $entry) {
  if (function_exists('gf_mailchimp')) {
    $feed = gf_mailchimp()->get_feed('40');
    if (!empty($feed)) {
      gf_mailchimp()->process_feed($feed, $entry, $form);
    }
  }
}, 10, 4);

Save token to current user

This example shows how you can save the resume token to the currently logged in user’s profile when an incomplete submission is saved.

add_action('gform_incomplete_submission_post_save', function ($submission, $resume_token, $form, $entry) {
  if (is_user_logged_in()) {
    update_user_meta(get_current_user_id(), '_gf_resume_token', $resume_token);
  }
}, 10, 4);