gform_payment_status

gform_payment_status

DescriptionUsageParametersExamplesPlacementSource Code

Description
Allows the payment status displayed for the entry in the Payment Details section to be modified.
Usage
add_filter( 'gform_payment_status', 'your_function_name', 10, 3 );

Parameters

$payment_status string
The payment status for the entry.

$form Form Object
The form.

$entry Entry Object
The entry.

Examples
add_filter( 'gform_payment_status', 'change_payment_status', 10, 3 );
function change_payment_status( $payment_status, $form, $entry ){
if ( $payment_status == 'Processing' ){
$payment_status = 'Testing';
}
return $payment_status;
}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GFEntryDetail::meta_box_payment_details() in entry_detail.php.

gform_payment_methods

gform_payment_methods

DescriptionUsageParametersExamplesPlacementSource Code

Description
Use this filter to add alternative payment methods to the Credit Card field.
Usage
add_filter( 'gform_payment_methods', 'your_function_name', 10, 3 );

Parameters

$payment_methods array
Array containing other loaded payment methods.

$field Field Object
The current field.

$form_id integer
The ID of the current form.

Examples
This example adds a payment method named Test Payment.
add_filter( 'gform_payment_methods', 'add_payment', 10, 3 );
function add_payment( $payment_methods, $field, $form_id ) {
$payment_methods[] = array( 'key' => 'testing', 'label' => 'Test Payment' );
return $payment_methods;
}

Placement
This code should be placed in the functions.php file of your active theme. If you are creating a plugin to integrate with Gravity Forms, this filter would go in your plugin file.
Source Code
This filter is located in GF_Field_CreditCard::get_field_input() in includes/fields/class-gf-field-creditcard.php.

gform_payment_date

gform_payment_date

DescriptionUsageParametersExamplesPlacementSource Code

Description
Allows the payment date displayed for the entry in the Payment Details section to be modified.
Usage
add_filter( 'gform_payment_date', 'your_function_name', 10, 3 );

Parameters

$payment_date string
The payment date for the entry.

$form Form Object
The form.

$entry Entry Object
The entry.

Examples
add_filter( 'gform_payment_date', 'change_payment_date', 10, 3 );
function change_payment_date( $payment_date, $form, $entry ){
//change date format to year/day/month
$payment_date = GFCommon::format_date( $payment_date, false, 'Y/d/m', $entry['transaction_type'] != 2 );
return $payment_date;
}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GFEntryDetail::meta_box_payment_details() in entry_detail.php.

gform_payment_amount

gform_payment_amount

DescriptionUsageParametersExamplesPlacementSource Code

Description
Allows the payment amount displayed for the entry in the Payment Details section to be modified.
Usage
add_filter( 'gform_payment_amount', 'your_function_name', 10, 3 );

Parameters

$payment_amount string
The payment amount for the entry.

$form Form Object
The form.

$entry Entry Object
The entry.

Examples
add_filter( 'gform_payment_amount', 'change_payment_amount', 10, 3 );
function change_payment_amount( $payment_amount, $form, $entry ){
return 'USD ' . $payment_amount;
}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GFEntryDetail::meta_box_payment_details() in entry_detail.php.

gform_password

gform_password

DescriptionUsageParametersExamplesSource Code

Description
Use this filter to change the Password Field sub-label.
Usage
The following would apply your function to all forms.
add_filter( 'gform_password', 'your_function_name', 10, 2 );

To target a specific form append the form id to the hook name. (format: gform_password_FORMID)
add_filter( 'gform_password_6', 'your_function_name', 10, 2 );

Parameters

$sublabel string
The sub-label to be filtered.

$form_id integer
ID of current form.

Examples
This example changes the password sub-label to 「Enter a password」.
add_filter( 'gform_password_185', 'set_password_label', 10, 2 );
function set_password_label( $sublabel, $form_id ) {
return 'Enter a password';
}

Source Code
This filter is located in GF_Field_Password::get_field_input() in includes/fields/class-gf-field-password.php.

gform_password_confirm

gform_password_confirm

DescriptionUsageParametersExamplesSource Code

Description
Use this filter to change the sub-label for the Confirm Password Field.
Usage
The following would apply your function to all forms.
add_filter( 'gform_password_confirm', 'your_function_name', 10, 2 );

To target a specific form append the form id to the hook name. (format: gform_password_confirm_FORMID)
add_filter( 'gform_password_confirm_6', 'your_function_name', 10, 2 );

Parameters

$sublabel string
The sub-label to be filtered.

$form_id integer
ID of current form.

Examples
This example changes the password sub-label to 「Enter your password again」.
add_filter( 'gform_password_confirm_185', 'set_password_label', 10, 2 );
function set_password_label( $sublabel, $form_id ) {
return 'Enter your password again';
}

Source Code
This filter is located in common.phpThis filter is located in GF_Field_Password::get_field_input() in includes/fields/class-gf-field-password.php.

gform_partialentries_warning_message

gform_partialentries_warning_message

DescriptionUsageParametersExamplesPlacementSource Code

Description
The 「gform_partialentries_warning_message」 filter in the Gravity Forms Partial Entries Add-On allows the warning message indicating the user』s information is being saved to be changed. The default warning message is 「Please note that your information is saved on our server as you enter it.」
Usage
The following would apply to all forms:
add_filter( "gform_partialentries_warning_message", "your_function_name", 10, 1 );

To target a specific form, append the form id to the hook name. (format: gform_partialentries_warning_message_FORMID)
add_filter( "gform_partialentries_warning_message_1", "your_function_name", 10, 1 );

Parameters

$warning_message string
The warning message.

Examples
add_filter( "gform_partialentries_warning_message", "change_warning_message", 10, 1 );
function change_warning_message( $warning_message ){
return "This is a test.";
}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GF_Partial_Entries::action_gform_enqueue_scripts() in gravityformspartialentries/class-gf-partial-entries.php.

gform_partialentries_pre_update

gform_partialentries_pre_update

DescriptionUsageParametersExamplesRestore field valuePlacementSinceSource Code

Description

The gform_partialentries_pre_update filter is used to modify an existing partial entry before the database is updated.

Usage

The following would run for all forms with the partial entries feature enabled when the partial entry is being updated by the Heartbeat API or when the user pages through a multi-page form.

add_filter( 'gform_partialentries_pre_update', 'your_function_name', 10, 3 );

You can also target a specific form by adding the form id after the hook name.

add_filter( 'gform_partialentries_pre_update_6', 'your_function_name', 10, 3 );

Parameters

$partial_entry Entry Object
The partial entry to be saved to the database. This will only contain the latest field values from the browser and a limited number of entry properties and meta. It won』t contain values set programmatically via other hooks and API methods.

$saved_entry Entry Object
The current version of the partial entry from the database.

$form Form Object
The form currently being processed.

Examples

Restore field value

The following example shows how a value from a field set programmatically, which is lost when the partial entry is updated, can be restored by copying it from the current version of the partial entry from the database.

add_filter( 'gform_partialentries_pre_update', function( $partial_entry, $saved_entry, $form ) {
$partial_entry['2'] = $saved_entry['2'];

return $partial_entry;
}, 10, 3 );

Placement

This code should be placed in the functions.php file of your active theme or a custom functions plugin.

Since

This filter was added in version 1.6.1.

Source Code

This filter is located in GF_Partial_Entries::filter_partial_entry_before_update() in class-gf-partial-entries.php.

gform_partialentries_post_EVENT

gform_partialentries_post_EVENT

DescriptionUsageEntry SavedEntry UpdatedParametersExamples1. Trigger Mailchimp Feeds2. Trigger Zapier Feeds3. Trigger Webhooks Feeds4. Trigger HubSpot FeedsSincePlacementSource Code

Description

Perform a custom action when the partial entry has been saved or updated.

Usage

Entry Saved

The following would run for all forms with the partial entries feature enabled when the entry_saved event occurs.

add_action( 'gform_partialentries_post_entry_saved', 'your_function_name', 10, 2 );

Entry Updated

The following would run for all forms with the partial entries feature enabled when the entry_updated event occurs.

add_action( 'gform_partialentries_post_entry_updated', 'your_function_name', 10, 2 );

Parameters

$partial_entry Entry Object
The partial entry object.

$form Form Object
The current form object.

Examples

1. Trigger Mailchimp Feeds

This example shows how you can send new partial entries to Mailchimp.

add_action( 'gform_partialentries_post_entry_saved', 'send_to_mailchimp_on_partial_entry_saved', 10, 2 );
function send_to_mailchimp_on_partial_entry_saved( $partial_entry, $form ) {
if ( function_exists( 'gf_mailchimp' ) ) {
$partial_entry['status'] = 'partial';
gf_mailchimp()->maybe_process_feed( $partial_entry, $form );
}
}

2. Trigger Zapier Feeds

This example shows how you can send new partial entries to Zapier.

add_action( 'gform_partialentries_post_entry_saved', 'send_to_zapier_on_partial_entry_saved', 10, 2 );
function send_to_zapier_on_partial_entry_saved( $partial_entry, $form ) {
if ( class_exists( 'GFZapier' ) ) {
GFZapier::send_form_data_to_zapier( $partial_entry, $form );
} elseif ( function_exists( 'gf_zapier' ) ) {
$partial_entry['status'] = 'partial';
gf_zapier()->maybe_process_feed( $partial_entry, $form );
}
}

Note: Depending on how long it takes the third-party API to respond to requests when processing the add-on feeds it could cause a delay when changing form pages.

3. Trigger Webhooks Feeds

This example shows how you can trigger Webhooks feeds for partial entries saved.

add_action( 'gform_partialentries_post_entry_saved', 'webhooks_on_partial_entry_saved', 10, 2 );
function webhooks_on_partial_entry_saved( $partial_entry, $form ) {
if ( function_exists( 'gf_webhooks' ) ) {
gf_webhooks()->maybe_process_feed( $partial_entry, $form );
gf_feed_processor()->save()->dispatch();
}
}

4. Trigger HubSpot Feeds

This example shows how you can trigger HubSpot feeds for partial entries saved.

add_action( 'gform_partialentries_post_entry_saved', 'send_to_hubspot_on_partial_entry_saved', 10, 2 );
function send_to_hubspot_on_partial_entry_saved( $partial_entry, $form ) {
GFCommon::log_debug( __METHOD__ . '(): running.' );
if ( function_exists( 'gf_hspot' ) ) {
$partial_entry['status'] = 'partial';
GFCommon::log_debug( __METHOD__ . '(): trigger Hubspot for Partial Entry: ' . print_r( $partial_entry, true ) );
gf_hspot()->maybe_process_feed( $partial_entry, $form );
}
}

Since

This hook was added in version 1.0-beta-2.3.

Placement

This code should be placed in the functions.php file of your active theme.

Source Code

This action hook is located in GF_Partial_Entries::maybe_save_partial_entry() in class-gf-partial-entries.php.

gform_page_loaded

gform_page_loaded

DescriptionUsageParametersExamplesCufon ScriptGoogle AnalyticsPlacementSource Code

Description
Fires on multi-page forms with AJAX submission enabled when changing pages (i.e. going to the next or previous page).
Usage

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
Cufon Script
This event is very useful when the popular font substitution script Cufon is being applied to a Gravity Form which uses the multi-page functionality and the AJAX form submission functionality. The snippet below provides an example usage of the gform_page_loaded event to refresh the Cufon font substitution for the newly loaded page.

Google Analytics
This example shows how to add Google Analytics tracking to every page in a multi-page form:

Placement
This code can be placed in an HTML field on your form or you may use the gform_pre_render hook to echo the script block to the page.
Source Code
This filter is located in form_display.php