gform_{$SHORT_SLUG}_field_value

gform_{$SHORT_SLUG}_field_value

DescriptionShort Slug ValuesUsageParametersExamples1. ActiveCampaign – Use Choice Text Instead of Value2. ActiveCampaign – Replace Commas with Pipes3. Emma – Format Checkbox Field4. Help Scout – Change Value of Specific Field5. Zoho CRM – Format Date Field6. Zoho CRM – Format Checkbox FieldPlacementSinceSource Code

Description
This filter can be used to modify a value before it is sent to a third-party by one of the Add-On Framework based add-ons. If you want to filter the value for any add-on you can use gform_addon_field_value.
Short Slug Values
The Gravity Forms Add-On Slugs article lists the available short slugs to use with this hook:
The following add-ons listed in the slug article do not use the hook:

Gravity Forms CLI Add-On
Gravity Forms Debug Add-On
Gravity Forms Gutenberg Add-On

The Zapier Add-On implements its own version of the hook:

gform_zapier_field_value

Usage
The base filter which would run for all forms and all fields would be used like so:
1add_filter( 'gform_helpscout_field_value', 'your_function_name', 10, 4 );
To target a specific form append the form id to the hook name. (format: gform_{$SHORT_SLUG}_field_value_FORMID)
1add_filter( 'gform_helpscout_field_value_10', 'your_function_name', 10, 4 );
To target a specific field append both the form id and the field id to the hook name. (format: gform_{$SHORT_SLUG}_field_value_FORMID_FIELDID)
1add_filter( 'gform_helpscout_field_value_10_3', 'your_function_name', 10, 4 );

Parameters

$value string
The value to be modified.

$form Form Object
The form currently being processed.

$entry Entry Object
The entry currently being processed.

$field_id string
The ID of the field currently being processed.

Examples
1. ActiveCampaign – Use Choice Text Instead of Value
This example shows how you can replace the value of a choice based survey field with the choice text.
1234567891011add_filter( 'gform_activecampaign_field_value', 'gf_get_choice_text', 10, 4 );function gf_get_choice_text( $value, $form, $entry, $field_id ) {    gf_activecampaign()->log_debug( __METHOD__ . '(): running.' );    $field = GFAPI::get_field( $form, $field_id );     if ( is_object( $field ) && $field->type == 'survey' ) {        $value = $field->get_value_export( $entry, $field_id, true );        gf_activecampaign()->log_debug( __METHOD__ . '(): Value: ' . $value );    }    return $value;}
2. ActiveCampaign – Replace Commas with Pipes
This example shows how you can replace the commas used to separate checkbox or multi select choices with pipe characters.
123456789101112add_filter( 'gform_activecampaign_field_value', 'gf_replace_commas_with_pipes', 10, 4 );function gf_replace_commas_with_pipes( $value, $form, $entry, $field_id ) {    gf_activecampaign()->log_debug( __METHOD__ . '(): running.' );    $field = GFAPI::get_field( $form, $field_id );     if ( is_object( $field ) && ( $field->type == 'checkbox' || $field->type == 'multiselect' ) ) {        $value = str_replace( ', ', '||', $value );        gf_activecampaign()->log_debug( __METHOD__ . '(): Value: ' . $value );    }     return $value;}
3. Emma – Format Checkbox Field
This example shows how you can reformat the checkbox field value to be passed as an array instead of a string.
123456789add_filter( 'gform_emma_field_value', function ( $value, $form, $entry, $field_id ) {    $field = GFAPI::get_field( $form, $field_id );     if ( is_object( $field ) && $field->get_input_type() === 'checkbox' ) {        $value = explode( ', ', $value );    }     return $value;}, 10, 4 );
4. Help Scout – Change Value of Specific Field
This example shows how you can change the value of field 3 on form 10 before it is passed to Help Scout.
1234add_filter( 'gform_helpscout_field_value_10_3', function ( $value, $form, $entry, $field_id ) {     return 'your new value';}, 10, 4 );
5. Zoho CRM – Format Date Field
This example shows how you can reformat the entry date from yyyy-mm-dd to the format configured on the field.
123456789add_filter( 'gform_zohocrm_field_value', function ( $value, $form, $entry, $field_id ) {    $field = GFAPI::get_field( $form, $field_id );     if ( is_object( $field ) && $field->type == 'date' ) {        $value = GFCommon::date_display( $value, $field->dateFormat );    }     return $value;}, 10, 4 );
6. Zoho CRM – Format Checkbox Field
This example shows how you can reformat the checkbox field value to pass true or false instead of the choice. This snippet is not needed if you』re using version 1.8 of the add-on or newer.
1234567891011add_filter( 'gform_zohocrm_field_value', function ( $value, $form, $entry, $field_id ) {    gf_zohocrm()->log_debug( __METHOD__ . '(): Running...' );    $field = GFAPI::get_field( $form, $field_id );     if ( is_object( $field ) && $field->get_input_type() === 'checkbox' ) {        gf_zohocrm()->log_debug( __METHOD__ . '(): Checkbox value to true or false.' );        $value = $value ? 'true' : 'false';    }     return $value;}, 10, 4 );
Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms 1.9.10.11.
Source Code
1234gf_apply_filters( "gform_{$slug}_field_value", array(    $form['id'],    $field_id), $field_value, $form, $entry, $field_id );
This filter is located in GFAddOn::maybe_override_field_value() in includes/addon/class-gf-addon.php.

gform_aweber_args_pre_subscribe

gform_aweber_args_pre_subscribe

DescriptionUsageParametersExamples1. Add ip_address ParameterPlacementSource Code

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

You can limit the scope of the filter to a single form by appending the form id on the end of the hook name like so:
add_filter( 'gform_aweber_args_pre_subscribe_5', 'your_function_name', 10, 4 );

Parameters

$args array
An associative array containing all the parameters to be passed to AWeber.

$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 ip_address Parameter
The following example shows how you can add the ip_address parameter.
add_filter( 'gform_aweber_args_pre_subscribe', function ( $args, $form, $entry, $feed ) {
$args['ip_address'] = rgar( $entry, 'ip' );

return $args;
}, 10, 4 );

Placement
Your code snippet should be placed in the functions.php file of your active theme.
Source Code
apply_filters( "gform_aweber_args_pre_subscribe_{$form['id']}", apply_filters( 'gform_aweber_args_pre_subscribe', $params, $form, $entry, $feed ), $form, $entry, $feed )

This filter is located in GFAWeber::export_feed() in class-gf-aweber.php.

gform_{$SHORT_SLUG}_field_value

gform_{$SHORT_SLUG}_field_value

DescriptionShort Slug ValuesUsageParametersExamples1. ActiveCampaign – Use Choice Text Instead of Value2. ActiveCampaign – Replace Commas with Pipes3. Emma – Format Checkbox Field4. Help Scout – Change Value of Specific Field5. Zoho CRM – Format Date Field6. Zoho CRM – Format Checkbox FieldPlacementSinceSource Code

Description
This filter can be used to modify a value before it is sent to a third-party by one of the Add-On Framework based add-ons. If you want to filter the value for any add-on you can use gform_addon_field_value.
Short Slug Values
The Gravity Forms Add-On Slugs article lists the available short slugs to use with this hook:
The following add-ons listed in the slug article do not use the hook:

Gravity Forms CLI Add-On
Gravity Forms Debug Add-On
Gravity Forms Gutenberg Add-On

The Zapier Add-On implements its own version of the hook:

gform_zapier_field_value

Usage
The base filter which would run for all forms and all fields would be used like so:
1add_filter( 'gform_helpscout_field_value', 'your_function_name', 10, 4 );
To target a specific form append the form id to the hook name. (format: gform_{$SHORT_SLUG}_field_value_FORMID)
1add_filter( 'gform_helpscout_field_value_10', 'your_function_name', 10, 4 );
To target a specific field append both the form id and the field id to the hook name. (format: gform_{$SHORT_SLUG}_field_value_FORMID_FIELDID)
1add_filter( 'gform_helpscout_field_value_10_3', 'your_function_name', 10, 4 );

Parameters

$value string
The value to be modified.

$form Form Object
The form currently being processed.

$entry Entry Object
The entry currently being processed.

$field_id string
The ID of the field currently being processed.

Examples
1. ActiveCampaign – Use Choice Text Instead of Value
This example shows how you can replace the value of a choice based survey field with the choice text.
1234567891011add_filter( 'gform_activecampaign_field_value', 'gf_get_choice_text', 10, 4 );function gf_get_choice_text( $value, $form, $entry, $field_id ) {    gf_activecampaign()->log_debug( __METHOD__ . '(): running.' );    $field = GFAPI::get_field( $form, $field_id );     if ( is_object( $field ) && $field->type == 'survey' ) {        $value = $field->get_value_export( $entry, $field_id, true );        gf_activecampaign()->log_debug( __METHOD__ . '(): Value: ' . $value );    }    return $value;}
2. ActiveCampaign – Replace Commas with Pipes
This example shows how you can replace the commas used to separate checkbox or multi select choices with pipe characters.
123456789101112add_filter( 'gform_activecampaign_field_value', 'gf_replace_commas_with_pipes', 10, 4 );function gf_replace_commas_with_pipes( $value, $form, $entry, $field_id ) {    gf_activecampaign()->log_debug( __METHOD__ . '(): running.' );    $field = GFAPI::get_field( $form, $field_id );     if ( is_object( $field ) && ( $field->type == 'checkbox' || $field->type == 'multiselect' ) ) {        $value = str_replace( ', ', '||', $value );        gf_activecampaign()->log_debug( __METHOD__ . '(): Value: ' . $value );    }     return $value;}
3. Emma – Format Checkbox Field
This example shows how you can reformat the checkbox field value to be passed as an array instead of a string.
123456789add_filter( 'gform_emma_field_value', function ( $value, $form, $entry, $field_id ) {    $field = GFAPI::get_field( $form, $field_id );     if ( is_object( $field ) && $field->get_input_type() === 'checkbox' ) {        $value = explode( ', ', $value );    }     return $value;}, 10, 4 );
4. Help Scout – Change Value of Specific Field
This example shows how you can change the value of field 3 on form 10 before it is passed to Help Scout.
1234add_filter( 'gform_helpscout_field_value_10_3', function ( $value, $form, $entry, $field_id ) {     return 'your new value';}, 10, 4 );
5. Zoho CRM – Format Date Field
This example shows how you can reformat the entry date from yyyy-mm-dd to the format configured on the field.
123456789add_filter( 'gform_zohocrm_field_value', function ( $value, $form, $entry, $field_id ) {    $field = GFAPI::get_field( $form, $field_id );     if ( is_object( $field ) && $field->type == 'date' ) {        $value = GFCommon::date_display( $value, $field->dateFormat );    }     return $value;}, 10, 4 );
6. Zoho CRM – Format Checkbox Field
This example shows how you can reformat the checkbox field value to pass true or false instead of the choice. This snippet is not needed if you』re using version 1.8 of the add-on or newer.
1234567891011add_filter( 'gform_zohocrm_field_value', function ( $value, $form, $entry, $field_id ) {    gf_zohocrm()->log_debug( __METHOD__ . '(): Running...' );    $field = GFAPI::get_field( $form, $field_id );     if ( is_object( $field ) && $field->get_input_type() === 'checkbox' ) {        gf_zohocrm()->log_debug( __METHOD__ . '(): Checkbox value to true or false.' );        $value = $value ? 'true' : 'false';    }     return $value;}, 10, 4 );
Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms 1.9.10.11.
Source Code
1234gf_apply_filters( "gform_{$slug}_field_value", array(    $form['id'],    $field_id), $field_value, $form, $entry, $field_id );
This filter is located in GFAddOn::maybe_override_field_value() in includes/addon/class-gf-addon.php.

gform_after_delete_form

gform_after_delete_form

DescriptionUsageParametersExamplesSource Code

Description
Use this action hook to perform actions right after a form is deleted.
Usage
1add_action( 'gform_after_delete_form', 'do_cleanup' );

Parameters

$form_id integer
ID of current form.

Examples
This example adds a log file entry when a form is deleted.
12345678add_action( 'gform_after_delete_form', 'log_form_deleted' );function log_form_deleted( $form_id ) {    $log_file = ABSPATH . '/gf_deleted_forms.log';    $f = fopen( $log_file, 'a' );    $user = wp_get_current_user();    fwrite( $f, date( 'c' ) . " - Form deleted by {$user->user_login}. Form ID: {$form_id}. n" );    fclose( $f );}
Source Code
This action hook is located in GFFormsModel::delete_form() in form_model.php.

gform_authorizenet_transaction_pre_capture_setup_fee

gform_authorizenet_transaction_pre_capture_setup_fee

DescriptionUsageParametersExamples1. Modify the AmountPlacementSource Code

Description
This filter can be used to modify the transaction object for the subscription setup fee before it is sent to Authorize.net.
Usage
The filter which would run for all 『subscription』 type Authorize.net feeds with a setup fee can be used like so:
add_filter( 'gform_authorizenet_transaction_pre_capture_setup_fee', 'your_function_name', 10, 5 );

Parameters

$transaction object
The Authorize.net transaction object.

$form_data Form Data
An associative array containing the form title, billing address, payment amount, setup fee amount, line items created using the submitted pricing field values and any discounts from coupons.

$config Authorize Net Config
The feed which is currently being processed.

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

$entry Entry Object
The entry which is currently being processed. Since version 2.1.8.

Examples
1. Modify the Amount
The following example shows how you can override the setup fee for a specific form.
add_filter( 'gform_authorizenet_transaction_pre_capture_setup_fee', 'set_fee_amount', 10, 4 );
function set_fee_amount( $transaction, $form_data, $config, $form ) {
if ( $form['id'] == 10 ) {
$transaction->amount = 50;
}

return $transaction;
}

Placement
Your code snippet should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GFAuthorizeNet::subscribe() in class-gf-authorizenet.php

gform_author_dropdown_args

gform_author_dropdown_args

DescriptionUsageParametersExamplesPlacementSource Code

Description
This filter is executed when the form editor is loaded, when creating the author drop down selection for the Post Fields. Use this hook to change the list of authors displayed in the drop down by filtering the $args parameter to be passed to the wp_dropdown_users( $args ) function.
Usage
Applies to all forms:
1add_filter( 'gform_author_dropdown_args', 'set_users' );
Applies to a specific form. In this case, form Id 5:
1add_filter( 'gform_author_dropdown_args_5', 'set_users' );
Parameters

$args array
The args to be filtered, in the format expected by the wp_dropdown_users() WordPress function.

Examples
This example changes the author drop down so that it includes two users (Ids 1 and 8):
12345add_filter( 'gform_author_dropdown_args', 'set_users' );function set_users( $args ) {    $args['include'] = '1,8';    return $args;}
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_advanced_settings

gform_advanced_settings

DescriptionUsageParametersExamplesSource Code

Description
Use this filter to create a new form setting under the Properties tab. Useful when implementing a new setting that applies to the form rather than a specific field.

This hook has been deprecated. Please use gform_form_settings instead.

Usage
1add_action( 'gform_advanced_settings', 'my_form_advanced_settings', 10, 2 );

Parameters

$position integer
Specifies the position that the settings will be displayed. For a list of all available positions, search form_detail.php for 「gform_advanced_settings」.

$form_id integer
The ID of the current form.

Examples
This hook functions identically to the gform_field_advanced_settings hook. The only difference is the location of where the custom setting is output. gform_field_advanced_settings|Reference this example for usage.
Source Code
This filter is located in the following methods:

GFFormDetail::forms_page() in form_detail.php
GFFormSettings::form_settings_ui() in form_settings.php

gform_address_types

gform_address_types

DescriptionUsageParametersExamples1. Brasil2. Australia3. United KingdomPlacementSinceSource Code

Description
This filter is executed when creating the address field (admin and front end). Use it to add support for a new address type.
Usage
The following would apply to all forms:
1add_filter( 'gform_address_types', 'brazilian_address', 10, 2 );
To target a specific form, append the form id to the hook name. (format: gform_address_types_FORMID)
1add_filter( 'gform_address_types_5', 'brazilian_address', 10, 2 );

Parameters

$address_types array
A list of all configured address types to be filtered. Following is the default declaration of this array.
123456789101112131415161718192021$addressTypes = array(        'international' => array(            'label'       => 'International',            'zip_label'   => 'Zip / Postal Code',            'state_label' => 'State/Province/Region'        ),        'us'            => array(            'label'       => 'United States',            'zip_label'   => 'Zip Code',            'state_label' => 'State',            'country'     => 'United States',            'states'      => GF_Fields::get( 'address' )->get_us_states(),        ),        'canadian'      => array(            'label'       => 'Canadian',            'zip_label'   => 'Postal Code',            'state_label' => 'Province',            'country'     => 'Canada',            'states'      => GF_Fields::get( 'address' )->get_canadian_provinces()        )    );

$form_id integer
The current form ID.

Examples
1. Brasil
This example adds a Brazilian address type to the list.
123456789101112131415add_filter( 'gform_address_types', 'brazilian_address', 10, 2 );function brazilian_address( $address_types, $form_id ) {    $address_types['brazil'] = array(        'label'       => 'Brasil',        'country'     => 'Brasil',        'zip_label'   => 'CEP',        'state_label' => 'Estado',        'states'      => array(            '', 'Acre', 'Alagoas', 'Amapa', 'Amazonas', 'Bahia', 'Ceara', 'Distrito Federal', 'Espirito Santo', 'Goias', 'Maranhao', 'Mato Grosso', 'Mato Grosso do Sul', 'Minas Gerais',            'Para', 'Paraiba', 'Parana', 'Pernambuco', 'Piaui', 'Roraima', 'Rondonia', 'Rio de Janeiro', 'Rio Grande do Norte', 'Rio Grande do Sul', 'Santa Catarina', 'Sao Paulo', 'Sergipe', 'Tocantins'        )    );     return $address_types;}
2. Australia
This example adds an Australian address type.
123456789101112131415161718192021add_filter( 'gform_address_types', 'australian_address_type' );function australian_address_type( $address_types ) {    $address_types['australia'] = array(        'label'       => 'Australian',        'country'     => 'Australia',        'zip_label'   => 'Postcode',        'state_label' => 'State',        'states'      => array(            'ACT' => 'Australian Capital Territory',            'NT'  => 'Northern Territory',            'NSW' => 'New South Wales',            'QLD' => 'Queensland',            'SA'  => 'South Australia',            'TAS' => 'Tasmania',            'VIC' => 'Victoria',            'WA'  => 'Western Australia',        )    );     return $address_types;}
3. United Kingdom
This example uses optgroups for the counties, a feature added in Gravity Forms 2.0-beta-2.2.
1234567891011121314151617181920212223242526add_filter( 'gform_address_types', 'uk_address', 10, 2 );function uk_address( $address_types, $form_id ) {    $address_types['uk'] = array(        'label'       => 'UK',        'country'     => 'United Kingdom',        'zip_label'   => 'Postcode',        'state_label' => 'County',        'states'      => array(            '',            'England'          => array(                'Avon', 'Bedfordshire', 'Berkshire', 'Buckinghamshire', 'Cambridgeshire', 'Cheshire', 'Cleveland', 'Cornwall', 'Cumbria', 'Derbyshire', 'Devon', 'Dorset', 'Durham', 'East Sussex', 'Essex', 'Gloucestershire', 'Hampshire', 'Herefordshire', 'Hertfordshire', 'Isle of Wight', 'Kent', 'Lancashire', 'Leicestershire', 'Lincolnshire', 'London', 'Merseyside', 'Middlesex', 'Norfolk', 'Northamptonshire', 'Northumberland', 'North Humberside', 'North Yorkshire', 'Nottinghamshire', 'Oxfordshire', 'Rutland', 'Shropshire', 'Somerset', 'South Humberside', 'South Yorkshire', 'Staffordshire', 'Suffolk', 'Surrey', 'Tyne and Wear', 'Warwickshire', 'West Midlands', 'West Sussex', 'West Yorkshire', 'Wiltshire', 'Worcestershire',            ),            'Wales'            => array(                'Clwyd', 'Dyfed', 'Gwent', 'Gwynedd', 'Mid Glamorgan', 'Powys', 'South Glamorgan', 'West Glamorgan',            ),            'Scotland'         => array(                'Aberdeenshire', 'Angus', 'Argyll', 'Ayrshire', 'Banffshire', 'Berwickshire', 'Bute', 'Caithness', 'Clackmannanshire', 'Dumfriesshire', 'Dunbartonshire', 'East Lothian', 'Fife', 'Inverness-shire', 'Kincardineshire', 'Kinross-shire', 'Kirkcudbrightshire', 'Lanarkshire', 'Midlothian', 'Moray', 'Nairnshire', 'Orkney', 'Peeblesshire', 'Perthshire', 'Renfrewshire', 'Ross-shire', 'Roxburghshire', 'Selkirkshire', 'Shetland', 'Stirlingshire', 'Sutherland', 'West Lothian', 'Wigtownshire',            ),            'Northern Ireland' => array(                'Antrim', 'Armagh', 'Down', 'Fermanagh', 'Londonderry', 'Tyrone',            ),        ),    );     return $address_types;}
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.4.
Source Code
This action hook is located in GF_Field_Address::get_address_types() in includes/fields/class-gf-field-address.php.

gform_advancedpostcreation_term_separator

gform_advancedpostcreation_term_separator

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
Filters the separator character used when separating term names.
Usage
add_filter( 'gform_advancedpostcreation_term_separator', 'your_function_name', 10, 1 );

Parameters

$separator string
The separator to be filtered.

Examples
add_filter( 'gform_advancedpostcreation_term_separator', 'set_separator', 10, 1 );
function set_separator( $separator ){
return '|';
}

Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in the Gravity Forms Advanced Post Creation version 1.0-beta-2.5.
Source Code
This filter is located in GF_Advanced_Post_Creation::get_mapped_taxonomies() in gravityformsadvancedpostcreation/class-gf-advancedpostcreation.php.