gform_is_ssl

gform_is_ssl

DescriptionUsageExamplesPlacementSource Code

Description
Use this filter to determine whether or not the current page is running securely (https). Useful when using a proxy server that does not set the $_SERVER[『HTTPS』] variable.
Usage
1add_filter( 'gform_is_ssl', '__return_true' );
Examples
1add_filter( 'gform_is_ssl', '__return_true' );
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GFCommon::is_ssl() in common.php

gform_include_thousands_sep_pre_format_number

gform_include_thousands_sep_pre_format_number

DescriptionUsageParametersExamples1. All fields and forms2. Specific fieldPlacementSource Code

Description
Use this filter to prevent the thousand separator being included when the number field value is formatted for display in the admin, notifications and confirmations.
Usage
add_filter( 'gform_include_thousands_sep_pre_format_number', 'your_function_name', 10, 2 );

Parameters

$include_separator boolean
Should the thousand separator be included. Default is true.

$field Field Object
The field that is currently being processed.

Examples
1. All fields and forms
This example shows how you can disable the thousand separator for all number fields on all forms.
add_filter( 'gform_include_thousands_sep_pre_format_number', '__return_false' );

2. Specific field
This example shows how you can disable the thousand separator for a specific field.
add_filter( 'gform_include_thousands_sep_pre_format_number', function ( $include_separator, $field ) {
return $field->formId == 20 && $field->id == 45 ? false : $include_separator;
}, 10, 2 );

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 in includes/fields/class-gf-field-number.php:

GF_Field_Number::get_field_input()
GF_Field_Number::get_value_entry_list()
GF_Field_Number::get_value_entry_detail()
GF_Field_Number::get_value_merge_tag()

gform_is_encrypted_field

gform_is_encrypted_field

DescriptionUsageParametersExamplePlacementSinceSource Code

Description
Determines if an entry field is stored encrypted. Use this hook to change the default behavior of decrypting fields that have been encrypted or to completely disable the process if checking for encrypted fields.
Usage
1add_filter( 'gform_is_encrypted_field', 'your_function_name', 10, 2 );

Parameters

$is_encrypted string
Defaults to 」

$entry_id int
The current Entry ID.

$field_id int
he current Field ID.

Example
1234add_filter( 'gform_is_encrypted_field', 'not_encrypted', 10, 3 );function not_encrypted( $is_encrypted, $entry_id, $field_id ){    return false;}
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.9.14.
Source Code
This filter is located in:
GFFormsModel::is_encrypted_field() in forms_model.php
GFFormsModel::is_openssl_encrypted_field() in forms_model.php.

gform_hubspot_output_tracking_script

gform_hubspot_output_tracking_script

DescriptionUsageParametersExamplePlacementSinceSource Code

Description
Allows the tracking script to be removed.
Usage
1add_filter( 'gform_hubspot_output_tracking_script', 'your_function_name', 10, 1 );

Parameters

$add_tracking bool
Whether to output the tracking script. The default is true.

Example
12345add_filter( 'gform_hubspot_output_tracking_script', 'turn_tracking_off', 10, 1 );function turn_tracking_off( $add_tracking ){    GFCommon::log_debug( __METHOD__ . '(): running.' );    return false;}
Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in HubSpot version 1.0.
Source Code
This filter is located in GF_HubSpot::action_wp_footer in class-gf-hubspot.php.

gform_list_field_parameter_delimiter

gform_list_field_parameter_delimiter

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
Allow modification of the delimiter used to parse List field URL parameters.
Usage
The following would apply to all forms.
add_filter( 'gform_list_field_parameter_delimiter', 'your_function_name', 10, 4 );

Parameters

$delimiter string
Defaults to 『|』.

$field Field Object
GF_Field object for the current field.

$name string
Name of the current dynamic population parameter.

$field_values array
Array of values provided for pre-population into the form.

Examples
add_filter( 'gform_list_field_parameter_delimiter', function( $delimiter, $field, $name, $field_values ) {
return '||';
}, 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 version 1.9.18.
Source Code
This filter is located in GFFormsModel::get_parameter_value() in forms_model.php.

gform_input_mask_script

gform_input_mask_script

DescriptionUsageParametersExamplesPlacementSource Code

Description

Use this filter to change the initialization script for the input mask script. Can be used to specify different initialization parameters.

Usage

add_filter( 'gform_input_mask_script', 'set_mask_script', 10, 4 );

To target a specific form append the form id to the hook name. (format: gform_input_mask_script_FORMID)

add_filter( 'gform_input_mask_script_6', 'set_mask_script', 10, 4 );

Parameters

$script stringThe script to be filtered.

$script = "jQuery('#input_{$form['id']}_{$field->id}').mask('" . esc_js( $mask ) . "').on('keypress', function(e){if(e.which == 13){jQuery(this).blur();} } );";

$form_id integerID of current form.$field_id integerID of current field.$mask stringCurrently configured mask retrieved from $field->inputMaskValue.

Examples

This example changes the placeholder character to a blank space (」 「)

add_filter( 'gform_input_mask_script_185', 'set_mask_script', 10, 4 );function set_mask_script( $script, $form_id, $field_id, $mask ) {    $script = "jQuery('#input_{$form_id}_{$field_id}').mask('" . esc_js( $mask ) . "',{placeholder:' '}).on('keypress', function(e){if(e.which == 13){jQuery(this).blur();} } );";      return $script;}

A full list of available initialization options can be found at:

https://github.com/digitalBush/jquery.maskedinput

Placement

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

Source Code

gf_apply_filters( 'gform_input_mask_script', $form['id'], $script, $form['id'], $field->id, $mask );

This filter is located in GFFormDisplay::get_input_mask_init_script() in form_display.php

gform_is_valid_conditional_logic_operator

gform_is_valid_conditional_logic_operator

DescriptionUsageParametersSinceSource Code

Description
Filter which checks whether the operator is valid. Allows custom operators to be validated.
Usage
add_filter( 'gform_is_valid_conditional_logic_operator', 'your_function_name', 10, 2 );

Parameters

$is_valid bool
Whether the operator is valid or not.

$operator string
The conditional logic operator.

Since
This filter was added in Gravity Forms 2.0.7.20.
Source Code
This filter is located in forms_model.php.

gform_incomplete_submission_post_get

gform_incomplete_submission_post_get

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
Allows the draft submission for Save and Continue to be overridden after it is retrieved from the database but before it used to populate the form.
Usage
1add_filter( 'gform_incomplete_submission_post_get', 'your_function_name', 10, 3 );

Parameters

$submission_json array
JSON encoded associative array containing the incomplete submission. The following is found in the array:
123456*    @type array      $submitted_values The submitted values.*    @type array      $partial_entry    The draft entry created from the submitted values.*    @type null|array $field_values     The dynamic population field values.*    @type int        $page_number      The forms current page number.*    @type array      $files            The uploaded file properties.*    @type string     $gform_unique_id  The unique id for this submission.

$resume_token string
The unique token which can be used to resume the incomplete submission at a later date/time.

$form Form Object
The form object.

Examples
12345678add_filter( 'gform_incomplete_submission_post_get', 'modify_incomplete_submission_after', 10, 3 );function modify_incomplete_submission_after( $submission_json, $resume_token, $form){    //change the user first name to Test in the saved data    $updated_json = json_decode( $submission_json );    $updated_json->submitted_values->{'1'}->{'1.3'} = 'Test';    $submission_json = json_encode($updated_json);    return $submission_json;}
Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms 2.3.4.
Source Code
This filter is located in GFFormsModel::filter_draft_submission_post_get() in forms_model.php.

gform_is_entry_detail_edit

gform_is_entry_detail_edit

DescriptionUsageParametersExamplePlacementSinceSource Code

Description
Allows the 「entry_detail_edit」 page to be marked as a regular page, not an admin or edit page, or a regular page to be marked as an Entry Detail Edit page. This filter is useful if you are creating custom entry edit pages.
Usage
add_filter( 'gform_is_entry_detail_edit', 'your_function_name', 10, 1 );

Parameters

$is_entry_detail_edit bool
Whether the current page is the Entry Detail Edit (entry_detail_edit) page.

Example
add_filter( 'gform_is_entry_detail_edit', 'set_entry_edit', 10, 1 );
function set_entry_edit( $is_entry_detail_edit ){
return false;
}

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.9.9.
Source Code
This filter is located in GFCommon::is_entry_detail_edit() in common.php.

gform_hubspot_submission_data

gform_hubspot_submission_data

DescriptionUsageParametersExampleChange value for pageNameRemove cookie valueCustom cookie valuePlacementSinceSource Code

Description

Allows the HubSpot submission data to be filtered before being sent to HubSpot.

Usage

The following would apply to all forms:

1add_filter( 'gform_hubspot_submission_data', 'your_function_name', 10, 4 );

To target a specific form, append the form id to the hook name. (format: gform_hubspot_submission_data_FORMID):

1add_filter( 'gform_hubspot_submission_data_1', 'your_function_name', 10, 4 );

Parameters

$submission_data array
The HubSpot submission data to be filtered. For more information about the data in this array, see HubSpot』s documentation.

$feed Feed Object
The current feed.

$entry Entry Object
The current entry.

$form Form Object
The current form.

Example

Change value for pageName

12345add_filter( 'gform_hubspot_submission_data', 'change_hubspot_submission_data', 10, 4 );function change_hubspot_submission_data( $submission_data, $feed, $entry, $form ){    $submission_data['context']['pageName'] = 'Testing by Gravity Forms';    return $submission_data;}

Remove cookie value

Using the following example a new contact will be created for each form submission, no matter if a cookie was set by the HubSpot tracking script in the visitor』s browser.

123456add_filter( 'gform_hubspot_submission_data', 'remove_cookie_value', 10, 4 );function remove_cookie_value( $submission_data, $feed, $entry, $form ){    GFCommon::log_debug( __METHOD__ . '(): running.' );    unset( $submission_data['context']['hutk'] );    return $submission_data;}

Custom cookie value

This example shows how you can replace the default cookie created by the HubSpot tracking script with your own custom cookie to define the hutk property.

12345add_filter( 'gform_hubspot_submission_data', 'custom_cookie_value', 10, 4 );function custom_cookie_value( $submission_data, $feed, $entry, $form ){    $submission_data['context']['hutk'] = rgar( $_COOKIE, 'your-cookie-name' );    return $submission_data;}

Placement

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

Since

This filter was added in HubSpot version 1.0.

Source Code

This filter is located in GF_HubSpot::generate_form_submission_object() in class-gf-hubspot.php.