gform_post_submission

gform_post_submission

DescriptionUsageParametersExamplesSource Code

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
1add_action( 'gform_post_submission', 'post_submission', 10, 2 );
Applies to a specific form. In this case, form Id 5
1add_action( 'gform_post_submission_5', 'post_submission', 10, 2 );

Parameters

$entry Entry Object
The entry that was just created.

$form Form Object
The form which was used to create the entry.

Examples
123456789101112add_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] . "

" . $entry[13] . "
";     //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

發表回覆

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