gform_post_update_entry

gform_post_update_entry

DescriptionUsageParametersExampleSource Code

Description
This hook fires after the entry has been updated via GFAPI::update_entry().
Usage
The following would run for any form:
1add_action( 'gform_post_update_entry', 'your_function_name', 10, 2 );
To target a specific form append the form id to the hook name. (format: gform_post_update_entry_FORMID)
1add_action( 'gform_post_update_entry_10', 'your_function_name', 10, 2 );

Parameters

$entry Entry Object
The entry after being updated.

$original_entry Entry Object
The entry before being updated.

Example
12345add_action( 'gform_post_update_entry', 'log_post_update_entry', 10, 2 );function log_post_update_entry( $entry, $original_entry ) {    GFCommon::log_debug( 'gform_post_update_entry: original_entry => ' . print_r( $original_entry, 1 ) );    GFCommon::log_debug( 'gform_post_update_entry: updated entry => ' . print_r( $entry, 1 ) );}
Source Code
This filter is located in GFAPI::update_entry() in includes/api.php.

gform_post_update_entry_property

gform_post_update_entry_property

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
Runs after an entry property is updated.
Usage
add_action( 'gform_post_update_entry_property','your_function_name', 10, 4 );

Parameters

$entry_id int
The current entry ID.

$property_name string
The property that was updated.

$property_value string
The new value of the property that was updated.

$previous_value string
The previous property value before the update.

Examples
add_action( 'gform_post_update_entry_property','after_entry_property_updated', 10, 4 );
function after_entry_property_updated ( $entry_id, $property_name, $property_value, $previous_value ){
//do not allow entries to be trashed
if ( $property_name == 'status' && $property_value == 'trash' ){
GFFormsModel::update_entry_property( $entry_id, 'status', 'active' );
}
}

Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms version 2.3.3.9.
Source Code
This filter is located in GFFormsModel::update_entry_property() in forms_model.php.

gform_post_subscription_started

gform_post_subscription_started

DescriptionUsageParametersExamplesSource Code

Description
The 「gform_post_subscription_started」 action in Gravity Forms is triggered after a new subscription is created, allowing further actions to be taken.
Usage
add_action( 'gform_post_subscription_started', 'my_function', 10, 2 );

Parameters

$entry Entry Object
The entry object.

$subscription array
$action = array(
'type' => '',
'amount' => '',
'transaction_type' => '',
'transaction_id' => '',
'subscription_id' => '',
'entry_id' => '',
'payment_status' => '',
'note' => '',
);

Examples
function my_function() {
//Do something here
}
add_action( 'gform_post_subscription_started', 'my_function', 10, 2 );

Source Code
do_action( 'gform_post_subscription_started', $entry, $subscription );
This action hook is located in GFPaymentAddOn::start_subscription() in includes/addon/class-gf-payment-addon.php.

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

gform_post_status_options

gform_post_status_options

DescriptionUsageParametersExamples1. Add a new status2. Remove a statusPlacementSource Code

Description
Use this filter to add custom post statuses to the post status drop down on the Properties tab of post fields.
Usage
add_filter( 'gform_post_status_options', 'your_function_name' );

Parameters

$post_status_options array
Array containing the statuses of Draft, Pending Review, Published

Examples
1. Add a new status
This example adds a custom status to the drop down.
add_filter( 'gform_post_status_options', 'add_custom_post_status' );
function add_custom_post_status( $post_status_options ) {
$post_status_options['custom_status'] = 'My Custom Status';
return $post_status_options;
}

2. Remove a status
This example removes Draft as being a selectable choice in the drop down.
add_filter( 'gform_post_status_options', 'add_custom_post_status' );
function add_custom_post_status( $post_status_options ) {
unset( $post_status_options['draft'] );
return $post_status_options;
}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in form_detail.php.

gform_post_send_entry_note

gform_post_send_entry_note

DescriptionUsageParametersExamplesSource Code

Description
The 「gform_post_send_entry_note」 action is triggered after an entry note is emailed, allowing further actions to be performed.
Usage
1add_action( 'gform_post_send_entry_note', 'my_function', 10, 7 );

Parameters

$result string
The success or failure message, based on if the email was sent successfully or not.

$email_to string
The address that the email was sent to.

$email_from string
The email address that the email was sent from.

$email_subject string
The subject of the email sent.

$body Mixed
The body of the email sent.

$form Form Object
The current form object.

$entry Entry Object
The current entry object.

Examples
1234function my_function() {    //Do something here}add_action( 'gform_post_send_entry_note', 'my_function', 10, 7 );
Source Code
This action hook is located in entry_detail.php.

gform_post_save_feed_settings

gform_post_save_feed_settings

DescriptionUsageParametersPlacementSinceSource Code

Description
Perform a custom action when a feed is saved.
Usage
do_action( 'gform_post_save_feed_settings', $result, $form_id, $settings, $this );

Parameters

$feed_id string
The ID of the feed which was saved.

$form_id int
The current form ID associated with the feed.

$settings array
An array containing the settings and mappings for the feed.

$addon GFAddon
The current instance of the GFAddOn object which extends GFFeedAddOn or GFPaymentAddOn (i.e. GFCoupons, GF_User_Registration, GFStripe).

Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms v2.4.12.3.
Source Code
This filter is located in class-gf-feed-addon.php.

gform_post_render

gform_post_render

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
This jQuery hook is fired every time the form is rendered to allow custom jQuery to be executed. This includes initial form load, going to the next/previous page on multi-page forms, form rendered with validation errors, confirmation message displayed, etc.
Usage
123456789

Parameters

event Event Object
The Javascript event object.

form_id integer
The ID of the form in use.

current_page integer
The page number of the page being loaded.

Examples
This event is very useful when you wish you create a custom datepicker and enable AJAX for a form. Without this event, the default Gravity Form datepicker would be used if the form were reloaded due to validation errors. With this event, you can reinitialize your custom datepicker every time the form is rendered.
12345678910111213
Placement
See the JavaScript section of the Where Do I Put This Code? article.
Since
This filter was added in Gravity Forms version 1.6.
Source Code
This filter is located in form_display.php

gform_post_recaptcha_render

gform_post_recaptcha_render

DescriptionUsageParametersExamples1. Basic usagePlacementSinceSource Code

Description
The gform_post_recaptcha_render JavaScript hook can be used to perform custom actions once the reCAPTCHA widget has been rendered.
Usage
123gform.addAction('gform_post_recaptcha_render', function (elem) {    // do something});

Parameters

elem Javascript Object
The div element which has the ginput_recaptcha class.

Examples
1. Basic usage
12345
Placement
Your code snippet can be placed in a HTML field on your form or in a theme custom JavaScript file.
Since
This hook was added in Gravity Forms 2.0.6.8.
Source Code
This hook is located in js/gravityforms.js

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.