gform_get_field_value

gform_get_field_value

DescriptionUsageParametersExamplePlacementSinceSource Code

Description
Filters the lead value.
Usage
add_filter( 'gform_get_field_value', 'your_function_name', 10, 3 );

Parameters

$value string
The value of the field.

$entry Entry Object
The current entry.

$field Field Object
The current field.

Example
add_filter( 'gform_get_field_value', 'change_field_value', 10, 3 );
function change_field_value( $value, $entry, $field ){
if ( $field['id'] == 1 ){
$value = 'Testing';
}
return $value;
}

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

GF_Entry_List_Table::column_default() in entry_list.php
GFFormsModel::get_lead_field_value() in forms_model.php

gform_get_entries_args_entry_list

gform_get_entries_args_entry_list

DescriptionUsageParametersExamplesFilter Entry List by Entry MetaPlacementSinceSource Code

Description
The gform_get_entries_args_entry_list filter is executed immediately before entries are fetched for display in the Entry List view. It provides the ability to filter all arguments that are passed to the GFAPI::get_entries() method thereby allowing you to filter which entries are displayed in the Entry List.
Usage
The following would apply to all forms.
add_filter( 'gform_get_entries_args_entry_list', 'your_function_name', 10, 2 );

The following would apply to only to form ID 1.
add_filter( 'gform_get_entries_args_entry_list_1', 'your_function_name', 10, 2 );

Parameters

$args array
Array of arguments that will be passed to GFAPI::get_entries() to fetch the entries to be displayed.

$form_id int
The form ID for which entries will be loaded.

$search_criteria array
An array of search critiera that will be used to filter entries.

$sorting array
An array containing properties that specify how the entries will be sorted.

$paging array
An array containing properties that specify how the entries will be paginated.

Examples
Filter Entry List by Entry Meta
This example demonstrates how you could pass parameter in the query string for a custom meta key and only show entries that match the specified value.
add_filter( 'gform_get_entries_args_entry_list', function( $args ) {

$meta_key = 'my_meta_key';
$meta_value = rgget( $meta_key );
if( ! $meta_value ) {
return $args;
}

if( ! isset( $args['search_criteria']['field_filters'] ) ) {
$args['search_criteria']['field_filters'] = array();
}

$args['search_criteria']['field_filters'][] = array(
'key' => $meta_key,
'value' => $meta_value
);

return $args;
} );

Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms 2.2.3.4.
Source Code
This filter is located in GF_Entry_List_Table::prepare_items() in entry_list.php.

gform_frontend_pages_evaluated

gform_frontend_pages_evaluated

DescriptionUsageParametersExamplesLog the parametersPlacementSinceSource Code

Description

The gform_frontend_pages_evaluated JavaScript action hook is used to perform custom actions when page conditional logic rules have been evaulated on the front-end.

Usage

The filter which runs for all would be used like so:

123gform.addAction( 'gform_frontend_pages_evaluated', function( pages, formId, pageLogic ) {    //do something}, 10, 3 );

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

123gform.addAction( 'gform_frontend_pages_evaluated_6', function( pages, formId, pageLogic ) {    //do something}, 10, 3 );

Parameters

pages array
A collection of page field objects.

formId int
The ID of the current form.

pageLogic JavaScript Object
The currrent GFPageConditionalLogic object.

Examples

Log the parameters

This example would log the contents of the three parameters to the browser console.

123gform.addAction( 'gform_frontend_pages_evaluated', function( pages, formId, pageLogic ) {    console.log( arguments );}, 10, 3 );

Placement

This code should be placed in a theme custom js file or a custom JS functions plugin.

Since

This filter was added in Gravity Forms v2.5.

Source Code

This filter is located in GFPageConditionalLogic.evaluatePages() in page_conditional_logic.js.

gform_frontend_page_visible

gform_frontend_page_visible

DescriptionUsageParametersExamplesLog the parametersPlacementSinceSource Code

Description

The gform_frontend_page_visible JavaScript action hook is used to perform custom actions when a page step is made visible by conditional logic on the front-end.

Usage

The filter which runs for all would be used like so:

gform.addAction( 'gform_frontend_page_visible', function( page, formId ) {
//do something
}, 10, 2 );

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

gform.addAction( 'gform_frontend_page_visible_6', function( page, formId ) {
//do something
}, 10, 2 );

Parameters

page JavaScript Object
The current page field object.

formId int
The ID of the current form.

Examples

Log the parameters

This example would log the contents of the three parameters to the browser console.

gform.addAction( 'gform_frontend_page_visible', function( page, formId ) {
console.log( arguments );
}, 10, 2 );

Placement

This code should be placed in a theme custom JS file or a custom JS functions plugin.

Since

This filter was added in Gravity Forms v2.5.

Source Code

This filter is located in GFPageConditionalLogic.showPage() in page_conditional_logic.js.

gform_frontend_page_hidden

gform_frontend_page_hidden

DescriptionUsageParametersExamplesLog the parametersPlacementSinceSource Code

Description

The gform_frontend_page_hidden JavaScript action hook is used to perform custom actions when a page step is hidden by conditional logic on the front-end.

Usage

The filter which runs for all would be used like so:

gform.addAction( 'gform_frontend_page_hidden', function( page, formId ) {
//do something
}, 10, 2 );

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

gform.addAction( 'gform_frontend_page_hidden_6', function( page, formId ) {
//do something
}, 10, 2 );

Parameters

page JavaScript Object
The current page field object.

formId int
The ID of the current form.

Examples

Log the parameters

This example would log the contents of the three parameters to the browser console.

gform.addAction( 'gform_frontend_page_hidden', function( page, formId ) {
console.log( arguments );
}, 10, 2 );

Placement

This code should be placed in a theme custom JS file or a custom JS functions plugin.

Since

This filter was added in Gravity Forms v2.5.

Source Code

This filter is located in GFPageConditionalLogic.hidePage() in page_conditional_logic.js.

gform_frontend_feeds_evaluated

gform_frontend_feeds_evaluated

DescriptionUsageParametersPlacementSinceSource Code

Description
The 「gform_frontend_feeds_evaluated」 JavaScript action in Gravity Forms fires after the conditional logic on the form has been evaluated, allowing further actions to be performed.
Usage
The following would apply to all forms:
12345gform.addAction('gform_frontend_feeds_evaluated', function (feeds, formId)   {      //do something  });
To target a specific form, append the form id to the hook name. (format: gform_frontend_feeds_evaluated_FORMID)
12345gform.addAction('gform_frontend_feeds_evaluated_1', function (feeds, formId)   {      //do something  });
To target a specific add-on, include the slug for the add-on after the 「gform」 text (format: gform_SLUG_frontend_feeds_evaluated)
12345gform.addAction('gform_gravityformsstripe_frontend_feeds_evaluated', function (feeds, formId)   {      //do something  });
To target a specific form and add-on, append the form id to the hook name, and include the slug for the add-on after the 「gform」 text (format: gform_SLUG_frontend_feeds_evaluated_FORMID)
12345gform.addAction('gform_gravityformsstripe_frontend_feeds_evaluated_1', function (feeds, formId)   {      //do something  });

Parameters

$feeds Feed Object
An array of feed objects.

$formId int
The form id.

Placement
Your code snippet can be placed in a HTML field on your form or in a theme custom JavaScript file.
Since
This action was added in Gravity Forms 2.4
Source Code
This filter is located in GFFrontendFeeds.evaluateFeeds() includes/addon/js/gaddon_frontend.js

gform_frontend_feed_deactivated

gform_frontend_feed_deactivated

DescriptionUsageParametersPlacementSinceSource Code

Description
The 「gform_frontend_feed_deactivated」 JavaScript action in Gravity Forms fires after the conditional logic on the form has been evaluated and the feed has become inactive, allowing further actions to be performed.
Usage
The following would apply to all forms:
12345gform.addAction('gform_frontend_feed_deactivated', function (feeds, formId)   {      //do something  });
To target a specific form, append the form id to the hook name. (format: gform_frontend_feed_deactivated_FORMID)
12345gform.addAction('gform_frontend_feed_deactivated_1', function (feeds, formId)   {      //do something  });
To target a specific add-on, include the slug for the add-on after the 「gform」 text (format: gform_SLUG_frontend_feed_deactivated)
12345gform.addAction('gform_gravityformsstripe_frontend_feed_deactivated', function (feeds, formId)   {      //do something  });
To target a specific form and add-on, append the form id to the hook name, and include the slug for the add-on after the 「gform」 text (format: gform_SLUG_frontend_feed_deactivated_FORMID)
12345gform.addAction('gform_gravityformsstripe_frontend_feed_deactivated_1', function (feeds, formId)   {      //do something  });

Parameters

$feeds Feed Object
An array of feed objects.

$formId int
The form id.

Placement
Your code snippet can be placed in a HTML field on your form or in a theme custom JavaScript file.
Since
This action was added in Gravity Forms 2.4
Source Code
This filter is located in GFFrontendFeeds.deactivateFeed() includes/addon/js/gaddon_frontend.js

gform_frontend_feed_activated

gform_frontend_feed_activated

DescriptionUsageParametersPlacementSinceSource Code

Description
The 「gform_frontend_feed_activated」 JavaScript action in Gravity Forms fires after the conditional logic on the form has been evaluated and the feed has been found to be active, allowing further actions to be performed.
Usage
The following would apply to all forms:
12345gform.addAction('gform_frontend_feed_activated', function (feeds, formId)   {      //do something  });
To target a specific form, append the form id to the hook name. (format: gform_frontend_feed_activated_FORMID)
12345gform.addAction('gform_frontend_feed_activated_1', function (feeds, formId)   {      //do something  });
To target a specific add-on, include the slug for the add-on after the 「gform」 text (format: gform_SLUG_frontend_feed_activated)
12345gform.addAction('gform_gravityformsstripe_frontend_feed_activated', function (feeds, formId)   {      //do something  });
To target a specific form and add-on, append the form id to the hook name, and include the slug for the add-on after the 「gform」 text (format: gform_SLUG_frontend_feed_activated_FORMID)
12345gform.addAction('gform_gravityformsstripe_frontend_feed_activated_1', function (feeds, formId)   {      //do something  });

Parameters

$feeds Feed Object
An array of feed objects.

$formId int
The form id.

Placement
Your code snippet can be placed in a HTML field on your form or in a theme custom JavaScript file.
Since
This action was added in Gravity Forms 2.4
Source Code
This filter is located in GFFrontendFeeds.activateFeed() includes/addon/js/gaddon_frontend.js

gform_freshbooks_send_item_id_for_fixed_dynamic

gform_freshbooks_send_item_id_for_fixed_dynamic

DescriptionUsageParametersPlacementSource Code

Description
This filter is used to enable the sending of the Item ID instead of Item Name when using the Fixed Costs or Dynamic Field Mapping settings.
Usage
1add_filter( 'gform_freshbooks_send_item_id_for_fixed_dynamic', '__return_true' );
Parameters
This hook has no parameters.
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in class-gf-freshbooks.php.

gform_freshbooks_enable_dynamic_field_mapping

gform_freshbooks_enable_dynamic_field_mapping

DescriptionUsageParametersPlacementSource Code

Description
This filter is used to enable the display of the option for dynamic field mapping under the 『Line Items』 setting on the Freshbooks feed. Dynamic field mapping allows you to map form fields to the line item』s unit cost and quantity.
Usage
1add_filter( 'gform_freshbooks_enable_dynamic_field_mapping', '__return_true' );
Parameters
This hook has no parameters.
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in class-gf-freshbooks.php.