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_entries_first_column_actions

gform_entries_first_column_actions

DescriptionUsageParametersExamples1. Print Entry Action2. Mark As PaidSource Code

Description
Use this action hook to add extra action links to the entry row on the entry list page.
Usage
add_action( 'gform_entries_first_column_actions', 'first_column_actions', 10, 5 );

Parameters

$form_id integer
The ID of the form from which the entry value was submitted.

$field_id integer
The ID of the field from which the entry value was submitted.

$value string
The entry value of the field id for the current lead.

$entry Entry Object
The current entry.

$query_string string
The current page』s Query String in the format 「name1=val1&name2=val2」.

Examples
1. Print Entry Action
This example demonstrates how to add Gravity Form』s print entry functionality (currently available on the Entry Detail page) as an action link on the Entries list page.
add_action( 'gform_entries_first_column_actions', 'first_column_actions', 10, 4 );
function first_column_actions( $form_id, $field_id, $value, $entry ) {
$url = add_query_arg( array(
'gf_page' => 'print-entry',
'fid' => $form_id,
'lid' => $entry['id'],
'notes' => '1',
), site_url() );

printf( '| Print', $url );

}

2. Mark As Paid
add_action( 'gform_entries_first_column_actions', function ( $form_id, $field_id, $value, $entry ) {
echo "|

gform_editor_sidebar_panels

gform_editor_sidebar_panels

DescriptionUsageParametersExamples1. Add a new panelPlacementSinceSource Code

Description
The gform_editor_sidebar_panels filter enables custom panels to be registered for display in the form editor sidebar. Use the gform_editor_sidebar_panel_content action hook to echo the panel content.
Usage
The filter which would run for all forms would be used like so:
add_filter( 'gform_editor_sidebar_panels', 'your_function_name', 10, 2 );

You can also target a specific form by adding the form id after the hook name.
add_filter( 'gform_editor_sidebar_panels_6', 'your_function_name', 10, 2 );

Parameters

$panels array
An array of custom sidebar panels.

$form Form Object
The form currently being edited.

Examples
1. Add a new panel
add_filter( 'gform_editor_sidebar_panels', function ( $panels, $form ) {
$panels[] = array(
// Define the unique ID for your panel.
'id' => 'my_custom_panel_1',
// Define the title to be displayed on the toggle button your panel.
'title' => 'My Custom Panel',
// Define an array of classes to be added to the toggle button for your panel.
'nav_classes' => array( 'my_nav_class_1', 'my_nav_class_2' ),
// Define an array of classes to be added to the body of your panel.
'body_classes' => array( 'my_body_class_1' ),
);

return $panels;
}, 10, 2 );

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 Gravity Forms v2.5.
Source Code
This filter is located in GFFormDetail::forms_page() in form_detail.php

gform_encrypt_password

gform_encrypt_password

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
Allows basic encryption of the password field.
Usage
1add_filter( 'gform_encrypt_password', 'your_function_name', 10, 3 );

Parameters

$encrypt_password bool
Whether to encrypt the Password field with true or false. The default is false.

$field Field Object
The field object.

$form Form Object
The form object.

Examples
1add_filter( 'gform_encrypt_password', '__return_true' );
1234567add_filter( 'gform_encrypt_password', 'encrypt_password', 10, 3 );function encrypt_password( $encrypt_password, $field, $form ){    if ( $form['id'] == 53 ){      $encrypt_password = true;    }    return $encrypt_password;}
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.8.9.
Source Code
This filter is located in GF_Field_Password::get_value_save_entry() in class-gf-field-password.php.

gform_duplicate_field

gform_duplicate_field

DescriptionUsageParametersExample(s)PlacementSinceSource Code

Description
The 「gform_duplicate_field」 JavaScript filter in Gravity Forms allows the field being duplicated in the Form Editor to be modified.
Usage
The following would apply to all field input types:
1gform.addFilter('gform_duplicate_field', 'change_duplicate' );
To target a specific type of field, append the field input type (ie: text, select, radio) to the hook name. (format: gform_duplicate_field_FIELDTYPE)
1gform.addFilter('gform_duplicate_field_text', 'change_duplicate' );

Parameters

field Field Object
The Field Object.

form Form Object
The Form Object.

Example(s)
This example uses the gform_admin_pre_render filter to load the hook and set the label of the field being duplicated to 『Duplicated Field』.
12345678910111213add_action( 'gform_admin_pre_render', 'add_duplicate_filter' );function add_duplicate_filter( $form ) {    ?>        

gform_entry_detail_meta_boxes

gform_entry_detail_meta_boxes

DescriptionUsageParametersExamples1. Enable the Payment Details2. User Registration Add-On3. Partial Entries Add-OnPlacementSource CodeSince

Description
The gform_entry_detail_meta_boxes filter can be used to add custom meta boxes to the entry detail page.
Usage
add_filter( 'gform_entry_detail_meta_boxes', 'your_function_name', 10, 3 );

Parameters

$meta_boxes array
The properties for the meta boxes. The default array is defined like so:
$meta_boxes = array(
'submitdiv' => array(
'title' => esc_html__( 'Entry', 'gravityforms' ),
'callback' => array( 'GFEntryDetail', 'meta_box_entry_info' ),
'context' => 'side',
),
'notifications' => array(
'title' => esc_html__( 'Notifications', 'gravityforms' ),
'callback' => array( 'GFEntryDetail', 'meta_box_notifications' ),
'context' => 'side',
),
);

If the user has the gravityforms_view_entry_notes capability then it will also contain the following:
$meta_boxes['notes'] = array(
'title' => esc_html__( 'Notes', 'gravityforms' ),
'callback' => array( 'GFEntryDetail', 'meta_box_notes' ),
'context' => 'normal',
);

If the entry has been processed by a payment add-on and the payment_status property is not empty then it will also contain the following:
$meta_boxes['payment'] = array(
'title' => $entry['transaction_type'] == 2 ? esc_html__( 'Subscription Details', 'gravityforms' ) : esc_html__( 'Payment Details', 'gravityforms' ),
'callback' => array( 'GFEntryDetail', 'meta_box_payment_details' ),
'context' => 'side',
'callback_args' => array( $entry, $form ),
);

$entry Entry Object
The entry currently being viewed/edited.

$form Form Object
The form object used to process the current entry.

Examples
1. Enable the Payment Details
This example shows how you can enable the payment details panel when the form isn』t being used with a payment add-on.
add_filter( 'gform_entry_detail_meta_boxes', 'add_payment_details_meta_box', 10, 3 );
function add_payment_details_meta_box( $meta_boxes, $entry, $form ) {
if ( ! isset( $meta_boxes['payment'] ) ) {
$meta_boxes['payment'] = array(
'title' => esc_html__( 'Payment Details', 'gravityforms' ),
'callback' => array( 'GFEntryDetail', 'meta_box_payment_details' ),
'context' => 'side',
'callback_args' => array( $entry, $form ),
);
}

return $meta_boxes;
}

2. User Registration Add-On
This example shows how you can add a meta box to the entry detail page to display the details of the user which was created from the entry. If a user does not exist for the entry it will show a button enabling feed processing to be triggered.
/**
* Add the meta box to the entry detail page.
*
* @param array $meta_boxes The properties for the meta boxes.
* @param array $entry The entry currently being viewed/edited.
* @param array $form The form object used to process the current entry.
*
* @return array
*/
function register_ur_meta_box( $meta_boxes, $entry, $form ) {
// If the add-on is active and the form has an active feed, add the meta box.
if ( function_exists( 'gf_user_registration' ) && gf_user_registration()->get_active_feeds( $form['id'] ) ) {
if ( gf_pending_activations()->is_entry_pending_activation( $entry ) ) {
return $meta_boxes;
}

$meta_boxes[ 'gf_user_registration' ] = array(
'title' => 'User Registration',
'callback' => 'add_ur_details_meta_box',
'context' => 'side',
);
}

return $meta_boxes;
}
add_filter( 'gform_entry_detail_meta_boxes', 'register_ur_meta_box', 10, 3 );

/**
* The callback used to echo the content to the meta box.
*
* @param array $args An array containing the form and entry objects.
*/
function add_ur_details_meta_box( $args ) {

$form = $args['form'];
$entry = $args['entry'];

$html = '';
$action = 'gf_user_registration_process_feeds';

// Retrieve the user from the current entry, if available.
$user = gf_user_registration()->get_user_by_entry_id( $entry['id'] );

if ( ! $user && rgpost( 'action' ) == $action ) {
check_admin_referer( 'gforms_save_entry', 'gforms_save_entry' );

// Because the entry doesn't already have a user and the 'Process Feeds' button was clicked process the feeds.
gf_user_registration()->maybe_process_feed( $entry, $form );

// Retrieve the user
$user = gf_user_registration()->get_user_by_entry_id( $entry['id'] );

$html .= 'Feeds Processed.

';
}

if ( ! $user ) {

// Add the 'Process Feeds' button.
$html .= sprintf( '', 'Process Feeds', $action );

} else {

// Display some user details.
$html .= 'Username: ' . $user->user_login . '

';
$html .= 'User ID: ' . $user->ID;
}

echo $html;
}

3. Partial Entries Add-On
This example shows how you can add a meta box to the entry detail page to display a button enabaling the partial entry to be marked as completed.
/**
* Add the meta box to the entry detail page and process the complete request.
*
* @param array $meta_boxes The properties for the meta boxes.
* @param array $entry The entry currently being viewed/edited.
* @param array $form The form object used to process the current entry.
*
* @return array
*/
function register_partial_entries_box( $meta_boxes, $entry, $form ) {
if ( class_exists( 'GF_Partial_Entries' ) ) {
$add_on = GF_Partial_Entries::get_instance();

if ( ! $add_on->is_enabled( $form['id'] ) ) {
return $meta_boxes;
}

$partial_entry_id = rgar( $entry, 'partial_entry_id' );
$action = 'gf_partial_entries_complete_entry';

if ( $partial_entry_id && rgpost( 'action' ) == $action ) {
check_admin_referer( 'gforms_save_entry', 'gforms_save_entry' );

$entry_id = $entry['id'];

gform_delete_meta( $entry_id, 'partial_entry_id' );
gform_delete_meta( $entry_id, 'date_saved' );
gform_delete_meta( $entry_id, 'resume_url' );
gform_delete_meta( $entry_id, 'resume_token' );

$entry = GFAPI::get_entry( $entry_id );
GFEntryDetail::set_current_entry( $entry );

return $meta_boxes;
}

if ( $partial_entry_id ) {
$meta_boxes['gf_partial_entries'] = array(
'title' => 'Partial Entries',
'callback' => 'add_partial_entries_meta_box',
'context' => 'side',
);
}
}

return $meta_boxes;
}

add_filter( 'gform_entry_detail_meta_boxes', 'register_partial_entries_box', 10, 3 );

/**
* The callback used to echo the content to the meta box.
*
* @param array $args An array containing the form and entry objects.
*/
function add_partial_entries_meta_box( $args ) {
$action = 'gf_partial_entries_complete_entry';
$html = sprintf( '', 'Complete Entry', $action );

echo $html;
}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GFEntryDetail::add_meta_boxes() in entry_detail.php.
Since
This filter was added in Gravity Forms 2.0-beta-3.

gform_enable_credit_card_field

gform_enable_credit_card_field

DescriptionUsageParametersExamplesPlacementSource Code

Description
Use this filter to enable/disable the built-in credit card field.

Note: The credit card field is only intended for use with a payment gateway add-on as the field values are not saved during form submission.

Usage
add_filter( 'gform_enable_credit_card_field', '__return_true', 11 );

Parameters

$is_enabled bool
Value to be filtered. Use 「true」 to enable the credit card field. Use 「false」 to disable it.

Examples
This example enables the credit card field for all forms. Add the field to the form in the Form Editor.
add_filter( 'gform_enable_credit_card_field', 'enable_creditcard', 11 );
function enable_creditcard( $is_enabled ) {
return true;
}

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

gform_entries_first_column

gform_entries_first_column

DescriptionUsageParametersExamplesSource Code

Description
Use this action hook to add content to the entry list』s first column.
Usage
1add_action( 'gform_entries_first_column', 'first_column_content', 10, 5 );

Parameters

$form_id integer
The ID of the form from which the entry value was submitted.

$field_id integer
The ID of the field from which the entry value was submitted.

$value string
The entry value of the field id for the current lead.

$entry Entry Object
The current entry.

$query_string string
The current page』s query string in the format 「name1=val1&name2=val2」.

Examples
This is a very basic example that demonstrates how to add the content 「Sample Text」 to the entry list』s first column.
1234add_action( 'gform_entries_first_column', 'first_column_content', 10, 5 );function first_column_content( $form_id, $field_id, $value, $entry, $query_string ) {    echo 'Sample text.';}
Source Code
This filter is located in GFEntryList::leads_page() in entry_list.php.

gform_email_background_color_data

gform_email_background_color_data

DescriptionUsageParametersExamplePlacementSinceSource Code

Description
Allows the background color for the field data in the html email to be changed.
Usage
1add_filter( 'gform_email_background_color_data', 'your_function_name', 10, 3 )

Parameters

$color string
The current background color. The default is #FFFFFF.

$field Field Object
The current field.

$entry Entry Object
The current entry.

Example
1234add_filter("gform_email_background_color_data", "set_email_data_color", 10, 3);        function set_email_data_color( $color, $field, $entry ){            return "#CCCCFF";        }
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.8.6.
Source Code
This filter is located in GFCommon::get_submitted_fields() in common.php.

gform_enqueue_scripts

gform_enqueue_scripts

DescriptionUsageParametersExamples1. Enqueue custom script2. Dequeue stylesheets3. Manually include RTL stylesheet4. Dequeue scriptPlacementSource Code

Description
This filter is executed during the process of enqueuing scripts for each form in the current page. When developing custom field types that require extra scripts, this hook should be used to enqueue the custom scripts when appropriate.
Usage
1add_action( 'gform_enqueue_scripts', 'your_function_name', 10, 2 );
You can also specify this per form by adding the form id after the hook name.
1add_action( 'gform_enqueue_scripts_6', 'your_function_name', 10, 2 );

Parameters

$form Form Object
The current form object.

$is_ajax bool
Specify if the form is configured to be submitted via AJAX.

Examples
1. Enqueue custom script
This example enqueues a custom script for all AJAX forms.
123456add_action( 'gform_enqueue_scripts', 'enqueue_custom_script', 10, 2 );function enqueue_custom_script( $form, $is_ajax ) {    if ( $is_ajax ) {        wp_enqueue_script( 'custom_script', 'path/file.js' );    }}
2. Dequeue stylesheets
This example shows how you can dequeue the stylesheets for a specific form.
12345678add_action( 'gform_enqueue_scripts_1', 'dequeue_gf_stylesheets', 11 );function dequeue_gf_stylesheets() {    wp_dequeue_style( 'gforms_reset_css' );    wp_dequeue_style( 'gforms_datepicker_css' );    wp_dequeue_style( 'gforms_formsmain_css' );    wp_dequeue_style( 'gforms_ready_class_css' );    wp_dequeue_style( 'gforms_browsers_css' );}
3. Manually include RTL stylesheet
Gravity Forms will automatically include the RTL stylesheet if WordPress indicates an RTL language is in use. However, if you haven』t set the language yet and want to test with the RTL styles, you can use the following to include the stylesheet.
12345add_action( 'gform_enqueue_scripts', 'enqueue_custom_script' );function enqueue_custom_script() {    $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG || isset( $_GET['gform_debug'] ) ? '' : '.min';    wp_enqueue_style( 'gforms_rtl_css', GFCommon::get_base_url() . "/css/rtl{$min}.css", null, GFCommon::$version );}
4. Dequeue script
This example shows how you can dequeue a form script for a specific form.
123add_action( 'gform_enqueue_scripts_1', function() {    wp_dequeue_script( 'gform_placeholder' );}, 11 );
Placement
This code should be placed in the header.php file of your active theme just before the wp_head() function call or a custom functions plugin.
Source Code
This filter is located in GFFormDisplay::enqueue_form_scripts() in form_display.php.