gform_column_input_content

gform_column_input_content

DescriptionUsageParametersExamplesPlacementSource Code

Description
This filter can be used to modify the HTML content of the list field column input tag.
Usage
1add_filter( 'gform_column_input_content', 'your_function_name', 10, 6 );
You can also target a specific column by adding the form id, field id and column number after the hook name. (format: gform_column_input_content_FORMID_FIELDID_COLUMN)
12//This filter declaration targets the third column of the field whose id is 9 in form whose id is 21add_filter( 'gform_column_input_content_21_9_3', 'your_function_name', 10, 6 );

Parameters

$input string
The current HTML content of the List field column

$input_info array
The input info array to be filtered, in the following format:
12345678910111213array(    'type' => 'select',    'choices' => 'First Choice,Second Choice'); // OR, if values need to be specified for each choice, the following format can also be used:array(    'type' => 'select',    'choices' => array(        array( 'text' => 'First Choice', 'value' => 'First' ),        array( 'text' => 'Second Choice', 'value' => 'Second' )    ));

$field Field Object
Current field.

$text string
Current column name.

$value string
Currently entered/selected value for the column』s input.

$form_id integer
ID of current form.

Examples
This example changes the third column of the list field to a textarea. To display the value on the entry in the admin, make sure you include using $value in the appropriate location for your tag creation.
12345678add_filter( 'gform_column_input_content_21_9_3', 'change_column3_content', 10, 6 );function change_column3_content( $input, $input_info, $field, $text, $value, $form_id ) {    //build field name, must match List field syntax to be processed correctly    $input_field_name = 'input_' . $field->id . '[]';    $tabindex = GFCommon::get_tabindex();    $new_input = '';    return $new_input;}
Placement
This code should be placed in the functions.php file of your active theme
Source Code
This filter is located in GF_Field_List::get_list_input() in includes/fields/class-gf-field-list.php

gform_field_choices

gform_field_choices

DescriptionUsageParametersExamplesPlacementSource Code

Description
This filter is executed when creating the checkbox or radio button items. It can be used to manipulate the item』s string before it gets added to the checkbox or radio button list.
Usage
1add_filter( 'gform_field_choices', 'form_submit_button', 10, 2 );
Parameters

$choices string
The string containing the choices to be filtered i.e.
1$field Field Object
The current field.

Examples
This example demonstrates how to allow HTML characters on checkbox and radio items.
12345add_filter( 'gform_field_choices', 'decode_specialchars', 10, 2 );function decode_specialchars( $choices, $field ) {    $choices = htmlspecialchars_decode( $choices );    return $choices;}
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in the following methods:

GF_Field_Checkbox::get_checkbox_choices() in includes/fields/class-gf-field-checkbox.php
GF_Field_Radio::get_radio_choices() in includes/fields/class-gf-field-radio.php

gform_card_security_code

gform_card_security_code

DescriptionUsageParametersExamplesPlacementSource Code

Description
This filter is executed when creating the credit card field and can be used to modify the 「Security Code」 label.
Usage
add_filter( 'gform_card_security_code', 'change_security_code', 10, 2 );

Parameters

$label string
The label to be filtered.

$form_id integer
The current form』s id.

Examples
This example changes the default Security Code label:
add_filter( 'gform_card_security_code', 'change_security_code', 10, 2 );
function change_security_code( $label, $form_id ) {
return "Security Code";
}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in js.php and GF_Field_CreditCard::get_field_input() in includes/fields/class-gf-field-creditcard.php.

gform_column_input

gform_column_input

DescriptionUsageParametersExamplesPlacementSource Code

Description
This filter can be used to specify a different input type for a list field column. Currently supported field types are 「select」 (Drop Down) and 「text」 (Text Field)
Usage
1add_filter( 'gform_column_input', 'set_column_input', 10, 5 );
You can also target a specific column by adding the form id, field id and column number after the hook name. (format: gform_column_input_FORMID_FIELDID_COLUMN)
12//This filter declaration targets the first column of field whose id is 2 in form whose id is 6add_filter( 'gform_column_input_6_2_1', 'set_column_input', 10, 5 );

Parameters

$input_info array
The input info array to be filtered, in the following format:
12345678910111213array(    'type' => 'select',    'choices' => 'First Choice,Second Choice'); // OR, if values need to be specified for each choice, the following format can also be used:array(    'type' => 'select',    'choices' => array(        array( 'text' => 'First Choice', 'value' => 'First' ),        array( 'text' => 'Second Choice', 'value' => 'Second' )    ));

$field Field Object
Current field.

$column string
Current column name.

$value string
Currently entered/selected value for the column』s input.

$form_id integer
ID of current form.

Examples
This example changes column 1 of list field 2 in a form with id 187 to a drop down.
1234add_filter( 'gform_column_input_187_2_1', 'set_column', 10, 5 );function set_column( $input_info, $field, $column, $value, $form_id ) {    return array( 'type' => 'select', 'choices' => 'First Choice,Second Choice' );}
Placement
This code should be placed in the functions.php file of your active theme
Source Code
This filter is located in GF_Field_List::get_list_input() in includes/fields/class-gf-field-list.php

gform_checkbox_deselect_all_label

gform_checkbox_deselect_all_label

DescriptionUsageParametersExamples1. All forms2. Specific form3. Specific checkbox field on a formPlacementSinceSource Code

Description
The 「gform_checkbox_deselect_all_label」 filter in Gravity Forms allows the 「Deselect All」 label for the Checkboxes field to be modified.
Usage
The following would apply to all forms:
add_filter( 'gform_checkbox_deselect_all_label', 'your_function_name', 10, 2 );

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

To target a specific field for a form, append the form id and field id to the hook name. (format: gform_checkbox_deselect_all_label_FORMID_FIELDID)
add_filter( 'gform_checkbox_deselect_all_label_1_22', 'your_function_name', 10, 2 );

Parameters

$select_label string
The 「Select All」 label.

$field Field Object
The field object for the current field.

Examples
1. All forms
add_filter( 'gform_checkbox_deselect_all_label', 'change_deselect_label', 10, 2 );
function change_deselect_label( $select_label, $field ){
return "My Custom Deselect All";
}

2. Specific form
add_filter( 'gform_checkbox_deselect_all_label_114', 'change_deselect_label', 10, 2 );
function change_deselect_label( $select_label, $field ){
return "My Custom Deselect All";
}

3. Specific checkbox field on a form
add_filter( 'gform_checkbox_deselect_all_label_114_2', 'change_deselect_label', 10, 2 );
function change_deselect_label( $select_label, $field ){
return "My Custom Deselect All";
}

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.
Source Code
This filter is located in GF_Field_Checkbox::get_checkbox_choices() in gravityforms/fields/includes/class-gf-field-checkbox.php.

gform_cdata_open

gform_cdata_open

DescriptionUsageParametersExamplesSource CodeSince

Description

These filters provide the ability to validate your forms with XHTML doctypes by allowing you to wrap the javascript output with the form in CDATA blocks.

Be aware. Using this function in conjunction with advanced form javascript will cause issues due to an issue with how WordPress handles CDATA tags.

Usage

add_filter( 'gform_cdata_open', 'my_cdata_open' );
add_filter( 'gform_cdata_close', 'my_cdata_close' );

Parameters

$cdata_string string
Empty by default. Return an opening or closing CDATA block respectively.

Examples

This example demonstrates how to wrap your form javascript in CDATA blocks.

add_filter( 'gform_cdata_open', 'my_cdata_open' );
function my_cdata_open() {
return '';
}
add_filter( 'gform_cdata_close', 'my_cdata_close' );
function my_cdata_close() {
return '';
}

Source Code

As of Gravity Forms 2.5.8, this filter is located in GFCommon::get_inline_script_tag() in common.php.

This filter was previously located in the following methods:

GFFormDisplay::get_form() in form_display.phpGFFormDisplay::footer_init_scripts() in form_display.phpGFFormDisplay::get_js_redirect_confirmation() in form_display.phpGFFormDisplay::get_form_init_scripts() in form_display.phpGF_Field_CAPTCHA::get_field_input() in includes/fields/class-gf-field-captcha.php

Since

Version 1.6.3

gform_conditional_logic_fields

gform_conditional_logic_fields

DescriptionUsageParametersExamplePlacementSinceSource Code

Description

The gform_conditional_logic_fields JavaScript filter in Gravity Forms allows filtering which fields are available for conditional logic and adding custom fields to conditional logic.

Usage

gform.addFilter( 'gform_conditional_logic_fields', function( options, form, selectedFieldId ) {
// do stuff

return options;
} );

Parameters

options arrayAn array consisting of each conditional logic field with its label and field id.form Form ObjectThe current form.selectedFieldId intThe ID of the selected field.

Example

add_action( 'admin_print_scripts', function () {

if ( method_exists( 'GFForms', 'is_gravity_page' ) && GFForms::is_gravity_page() ) { ?>

gform_campaignmonitor_override_subscriber

gform_campaignmonitor_override_subscriber

DescriptionUsageParametersExamples1. Add RestartSubscriptionBasedAutoresponders parameterPlacementSource Code

Description
This filter can be used to modify the subscriber parameters before they are sent to Campaign Monitor.
Usage
The filter which would run for all Campaign Monitor feeds can be used like so:
add_filter( 'gform_campaignmonitor_override_subscriber', 'your_function_name', 10, 4 );

Parameters

$subscriber array
An associative array containing all the parameters to be passed to Campaign Monitor.

$form Form Object
The Form which is currently being processed.

$entry Entry Object
The Entry which is currently being processed.

$feed Feed Object
The Feed which is currently being processed.

Examples
1. Add RestartSubscriptionBasedAutoresponders parameter
This example shows how you can add the RestartSubscriptionBasedAutoresponders parameter to the subscriber array. This will restart the any automated workflows for resubscribed subscribers, more details in Campaign Monitor API docs.
add_filter( 'gform_campaignmonitor_override_subscriber', function ( $subscriber, $entry, $form, $feed ) {
$subscriber['RestartSubscriptionBasedAutoresponders'] = true;

return $subscriber;
}, 10, 4 );

Placement
Your code snippet should be placed in the functions.php file of your active theme.
Source Code
apply_filters( 'gform_campaignmonitor_override_subscriber', $subscriber, $entry, $form, $feed )

This filter is located in GFCampaignMonitor::export_feed() in class-gf-campaignmonitor.php.

gform_breeze_card

gform_breeze_card

DescriptionUsageParametersExamplesSource Code

Description
The 「gform_breeze_card」 filter in the Gravity Breeze Add-On filters which card is created by the add-on.
Usage
add_filter( 'gform_breeze_card', 'my_function', 10, 4 );

Parameters

$card array
The card that is being filtered.

$feed array
The feed object.

$entry array
The entry object.

$form array
The form object.

Examples
function my_function( $card, $feed, $entry, $form ) {
//Do something here
return $card;
}
add_filter( 'gform_breeze_card', 'my_function', 10, 4 );

Source Code
This filter is located in class-gf-breeze.php.

gform_card_details

gform_card_details

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
This filter is executed when creating the Stripe Card or Square field and can be used to modify the 「Card Details」 label.
Usage
1add_filter( 'gform_card_details', 'change_details', 10, 2 );
Parameters

$label string
The label to be filtered.

$form_id integer
The current form』s id.

Examples
This example changes the default Card Details label:
1234add_filter( 'gform_card_details', 'change_details', 10, 2 );function change_details( $label, $form_id ) {    return "Credit Card Specifics";}
Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Stripe 2.6 and Square 1.0.
Source Code
Stripe add-on: This filter is located in GF_Field_Stripe_CreditCard::get_form_editor_inline_script_on_page_render() in gravityformsstripe/includes/class-gf-field-stripe-creditcard.php
Square add-on: This filter is located in GF_Field_Square_CreditCard::get_form_editor_inline_script_on_page_render() in gravityformssquare/includes/class-gf-field-square-creditcard.php