gform_currency_setting_message

gform_currency_setting_message

DescriptionUsageParametersExamplesPlacementSource Code

Description
The gform_currency_setting_message action hook is used to add a message after the currency drop down within the Settings page.
Usage
add_action( 'gform_currency_setting_message', 'currency_message' );

Parameters

$message string
The default message. An empty string.

Examples
This example adds a message below the currency drop down.
add_action( 'gform_currency_setting_message', 'currency_message' );
function currency_message() {
esc_html_e( 'US Dollars is the only supported currency by this payment gateway.', 'your_text_domain_here' );
}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This action hook was originally located in GFSettings::gravityforms_settings_page() in settings.php. In Gravity Forms 2.5 it was moved to GFSetting::currency_message_callback().

gform_delete_meta()

gform_delete_meta()

DescriptionUsageParametersExamplesSource Code

Description
Deletes the meta key from the Entry Meta table.
Usage
gform_delete_meta( $entry_id, $meta_key );

Parameters

$entry_id integer
The ID of the entry.

$meta_key string
The meta key of the meta value you wish to delete.

Examples
This example simply deletes a stored entry meta value.
// deletes the meta value of the "temporary_value" entry meta key for entry ID 13
gform_delete_meta( 13, 'temporary_value' );

Source Code
This function is located in forms_model.php

gform_coupons_is_valid_code

gform_coupons_is_valid_code

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
Overrides coupon code alphanumeric checking.
Usage
add_filter( 'gform_coupons_is_valid_code', 'your_function_name', 10, 2 );

Parameters

$is_alphanumeric bool
If the coupon code is alphanumeric.

$field Field Object
The field object.

Examples
add_filter( 'gform_coupons_is_valid_code', 'mark_coupon_valid', 10, 2 );
function mark_coupon_valid( $alphanumeric, $field ){
return true;
}

Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms Coupons Add-On version 2.4.
Source Code
This filter is located in GFCoupons::check_if_duplicate_coupon_code() in gravityformscoupons/class-gf-coupons.php.

GFORM_DB_MIGRATION_BATCH_SIZE

GFORM_DB_MIGRATION_BATCH_SIZE

DescriptionUsagePlacement

Description
The database schema was changed with Gravity Forms version 2.3. When upgrading from previous versions, the upgrade occurs in the background in batches. This constant allows the batch size to be changed from the default of 20000.
Usage
1define( 'GFORM_DB_MIGRATION_BATCH_SIZE', 50000 );
Placement
This constant should be set in your wp-config.php. See the article Wp Config Options for more details.

gform_consent_checked_indicator_markup

gform_consent_checked_indicator_markup

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
The 「gform_consent_checked_indicator_markup」 filter in Gravity Forms allows the HTML markup of the Consent check box to be modified.
Usage
add_filter( 'gform_consent_checked_indicator_markup', 'your_function_name', 10, 1 );

Parameters

$checked_indicator_markup string
The current HTML markup.

Examples
add_filter( 'gform_consent_checked_indicator_markup', 'change_markup', 10, 1 );
function change_markup( $checked_indicator_markup ){
return '' . $checked_indicator_markup . '';
}

Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms 2.4.
Source Code
This filter is located in GF_Field_Consent::__construct() in gravityforms/includes/fields/class-gf-field-consent.php.

gform_currency

gform_currency

DescriptionUsageParametersExamplesPlacementSource Code

Description
Use this filter to override the currency configured on the Forms > Settings page. It will affect all forms.
Usage
1add_filter( 'gform_currency', 'your_function_name' );

Parameters

$currency string
The currency code to be filtered.

Examples
This example forces the current currency to USD (US dollars).
1234add_filter( 'gform_currency', 'usd_currency' );function usd_currency( $currency ) {    return 'USD';}
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
1apply_filters( 'gform_currency', $currency )
This filter is located in GFCommon::get_currency() in common.php.

gform_disable_address_map_link

gform_disable_address_map_link

DescriptionUsageParametersPlacementSource Code

Description
This filter is used to disable the inclusion of the Map It link when displaying the Address field value.
Usage
1add_filter( 'gform_disable_address_map_link', '__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 GF_Field_Address::get_value_entry_detail() in includes/fields/class-gf-field-address.php.

gform_coupons_post_delete_coupon

gform_coupons_post_delete_coupon

DescriptionUsageParametersPlacementSinceSource Code

Description
This JavaScript action fires after a coupon is deleted from a field, allowing further actions to be performed.
Usage
123gform.addAction( 'gform_coupons_post_delete_coupon', function ( code, formId ) {    // do stuff} );

Parameters

code string
The coupon code which was deleted.

formId int
The ID of the current form.

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 Coupons Add-On version 2.9.
Source Code
This hook is located in DeleteCoupon() in gravityformscoupons/js/coupons.js.

gform_default_address_type

gform_default_address_type

DescriptionUsageParametersExamplesAustraliaPlacementSinceSource Code

Description
The gform_default_address_type filter can be used to override the default address type for new fields. It can be used together with the gform_address_types filter to add support for new country specific address types.
Usage
The base filter which would run for all forms would be used like so:
1add_filter( 'gform_default_address_type', 'your_function_name', 10, 2 );
To target a specific form append the form id to the hook name. (format: gform_default_address_type_FORMID)
1add_filter( 'gform_default_address_type_5', 'your_function_name', 10, 2 );

Parameters

$default_address_type string
The default address type, international.

$form_id integer
The current form ID

Examples
Australia
This example shows how the default address type can be set to Australia. The Australian address type would need to have been added by the gform_address_types filter.
123add_filter( 'gform_default_address_type', function ( $default_address_type, $form_id ) {    return 'australia';}, 10, 2 );
Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms 2.0.3.2.
Source Code
This filter is located in GF_Field_Address::get_default_address_type() in includes/fields/class-gf-field-address.php.

gform_consent_checked_indicator

gform_consent_checked_indicator

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
The 「gform_consent_checked_indicator」 filter in Gravity Forms allows the Consent check mark image to be changed.
Usage
add_filter( 'gform_consent_checked_indicator', 'your_function_name', 10, 1 );

Parameters

$checked_indicator_url string
The URL of the image being used for the check mark.

Examples
add_filter( 'gform_consent_checked_indicator', 'change_image', 10, 1 );
function change_image( $checked_indicator_url ){
return GFCommon::get_base_url() . '/images/star1.png';
}

Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms 2.4.
Source Code
This filter is located in GF_Field_Consent::__construct() in gravityforms/includes/fields/class-gf-field-consent.php.