gform_post_submission

Description

This action hook is executed at the end of the submission process (after form validation, notification, and entry creation) when the confirmation is configured to redirect to a page or URL. Use this hook to perform actions after the entry has been created (i.e. feed data to third party applications). The Entry Object is available to this hook and contains all submitted values.

This hook has been deprecated. Please use gform_after_submission instead.

Usage

Applies to all forms

add_action( 'gform_post_submission', 'post_submission', 10, 2 );

Applies to a specific form. In this case, form Id 5

add_action( 'gform_post_submission_5', 'post_submission', 10, 2 );

Parameters

  • $entry Entry ObjectThe entry that was just created.
  • $form Form ObjectThe form which was used to create the entry.

Examples

add_action( 'gform_post_submission', 'set_post_content', 10, 2 );
function set_post_content( $entry, $form ) {

    //getting post
    $post = get_post( $entry['post_id'] );

    //changing post content
    $post->post_content = "Blender Version:" . $entry[7] . "<br/> <img src='" . $entry[8] . "'> <br/> <br/> " . $entry[13] . " <br/> <img src='" . $entry[5] . "'>";

    //updating post
    wp_update_post( $post );
}

Source Code

This action hook is located in the following methods:

  • GFFormDisplay::process_form() in form_display.php
  • GFFormDisplay::get_form() in form_display.php