gform_signature_delete_file_pre_delete_entry

gform_signature_delete_file_pre_delete_entry

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
Enables the ability to disable deletion of the signature file or trigger deletion at a later time when an entry is deleted.
Usage
1add_filter( 'gform_signature_delete_file_pre_delete_entry', 'your_function_name', 10, 4 );

Parameters

$delete_file bool
Indicates whether the file should be deleted. Defaults to true.

$form Form Object
The current form.

$entry_id int
The ID of the current entry.

$field_id int
The ID of the current field.

Examples
12345//keep signatureadd_filter( 'gform_signature_delete_file_pre_delete_entry', 'keep_signature', 10, 4 );function keep_signature( $delete_file, $form, $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 version 3.8.
Source Code
This filter is located in GFSignature::delete_entry() in class-gf-signature.php.

gform_shortcode_user

gform_shortcode_user

Description

Description
The 「gform_shortcode_user」 filter in the Gravity Forms User Registration Add-On is a hook name that is dynamically generated. The hook gform_shortcode_{ACTION} in Gravity Forms is the actual hook that is run. The 「ACTION」 portion of the hook name is replaced with the 「user」 text.
Go to gform_shortcode_{ACTION} for details on using this hook.

gform_shortcode_preview_disabled

gform_shortcode_preview_disabled

DescriptionUsageParametersExamplePlacementSource Code

Description
This filter is used to enable/disable the shortcode preview within the Add Form button.
Usage
add_filter( 'gform_shortcode_preview_disabled', 'your_function_name' );

Parameters

$preview_disabled bool
Determines if the shortcode preview should be disabled. Defaults to true (disabled).

Example
add_filter( 'gform_shortcode_preview_disabled', 'your_function_name' );

function your_function_name() {
// Enables the shortcode preview
return false;
}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in gravityforms.php.

gform_shortcode_login

gform_shortcode_login

Description

Description
The 「gform_shortcode_login」 filter in the Gravity Forms User Registration Add-On is a hook name that is dynamically generated. The hook gform_shortcode_{ACTION} in Gravity Forms is the actual hook that is run. The 「ACTION」 portion of the hook name is replaced with the 「login」 text.
Go to gform_shortcode_{ACTION} for details on using this hook.

gform_shortcode_ACTION

gform_shortcode_ACTION

DescriptionUsageParametersExamplesAdding a custom actionOutput hidden comment for inactive formsPlacementSource Code

Description
The 「gform_shortcode_$action」 filter in Gravity Forms is used to implement custom shortcode actions. The action is specified after 「gform_shortcode_」.
Usage
Specify the action name after the gform_shortcode_ hook name, e.g.:
add_filter( 'gform_shortcode_form_property', 'custom_action', 10, 3 );

Parameters

$shortcode_string string
The full shortcode string.

$attributes array
Array of the shortcode attributes.
array (
'id' => '22',
'name' => 'Poll',
'action' => 'form_property',
'property' => 'title'
);

$content string
The content text of the shortcode if it exists.

Examples
Adding a custom action
The example below has the following shortcode setup on a page:
[gravityform id="22" name="Poll" action="form_property" property="title"]
my content
[/gravityform]

…and uses the following hook setup with the action 「form_property」. The 「property」 is retrieved and used to display the title of the form.
add_filter( 'gform_shortcode_form_property', 'custom_action', 10, 3 );
function custom_action( $string, $attributes, $content ) {
//get the shortcode attributes into variables, default values set for some
//the "property" attribute set in the shortcode has been added to the shortcode array
extract( shortcode_atts( array(
'title' => true,
'description' => true,
'id' => 0,
'name' => *,
'field_values' => "",
'ajax' => false,
'tabindex' => 1,
'action' => 'form',
'property' => *
), $attributes ) );
$form = RGFormsModel::get_form_meta( $id ); //get the form object
$property_value = $form[ $property ]; //retrieve the "property" from the form object
$info = "The property to retrieve is {$property} with value {$property_value}.";
return $info;
}

Output hidden comment for inactive forms
This example shows how a HTML comment can be included in the page source code when a form is set to inactive.
add_filter( 'gform_shortcode_form', function ( $shortcode_string, $attributes ) {
if ( empty( $shortcode_string ) ) {
$shortcode_string = sprintf( '', rgar( $attributes, 'name', rgar( $attributes, 'id' ) ) );
}

return $shortcode_string;
}, 10, 2 );

Placement
This code may be placed in the functions.php file of your active theme OR in your plugin code.
Source Code
This filter is located in GFForms::parse_shortcode() in gravityforms.php.

gform_shortcode_builder_forms

gform_shortcode_builder_forms

DescriptionUsageParametersExamples1. RemovePlacementSinceSource Code

Description
The gform_shortcode_builder_forms filter allows the list of available forms displayed in the shortcode builder to be overridden.
Usage
The filter would be used like so:
add_filter( 'gform_shortcode_builder_forms', 'your_function_name' );

Parameters

$forms array
A collection of active forms on site using the form id as the key to the form title.

Examples
1. Remove
This example removes form id 1 from the list of forms which can be embedded using the shortcode builder.
add_filter( 'gform_shortcode_builder_forms', function ( $forms ) {
unset( $forms[1] );

return $forms;
} );

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.4.22.5.
Source Code
This filter is located in GFForms::get_shortcodes() in gravityforms.php.

gform_{$short_slug}_is_valid_payment_amount

gform_{$short_slug}_is_valid_payment_amount

DescriptionShort Slug ValuesUsageParametersExamples1. PayPal custom minimum amountPlacementSinceSource Code

Description
This filter allows custom logic to be used to determine if a payment add-on which extends GFPaymentAddOn should process the submission for the given amount.
Short Slug Values
The Gravity Forms Add-On Slugs article lists the available short slugs to use with this hook.
Usage
The base filter which would run for all forms and all fields would be used like so:
add_filter( 'gform_stripe_is_valid_payment_amount', 'your_function_name', 10, 5 );

To target a specific form append the form id to the hook name. (format: gform_{$SHORT_SLUG}_field_value_FORMID)
add_filter( 'gform_stripe_is_valid_payment_amount_10', 'your_function_name', 10, 5 );

Parameters

$is_valid bool
Indicates if the amount is valid for processing. Default is true when the amount is greater than zero.

$submission_data Submission Data Object
Contains the form title, payment amount, setup fee amount, trial amount, line items created using the submitted pricing field values, and any discounts from coupons.

$feed Feed Object
The feed to be processed.

$form Form Object
The form currently being processed.

$entry Entry Object
The temporary entry containing the submitted values.

Examples
1. PayPal custom minimum amount
This example shows how you can prevent the add-on proccessing submissions where the amount is less than $1.
add_filter( 'gform_stripe_is_valid_payment_amount', function( $is_valid, $submission_data ) {

return floatval( $submission_data['payment_amount'] ) > 1;
}, 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.4.18.
Source Code
$tag_args = array( sprintf( 'gform_%s_is_valid_payment_amount', $this->get_short_slug() ), $form_id );
$is_valid = (bool) gf_apply_filters( $tag_args, $is_valid, $submission_data, $feed, $form, $entry );

This filter is located in GFPaymentAddOn::is_valid_payment_amount() in includes/addon/class-gf-payment-addon.php.

gform_settings_SUBVIEW

gform_settings_SUBVIEW

DescriptionUsageParametersExamplesSource Code

Description
Triggered within the settings page, depending on what page within the settings you are viewing. SUBVIEW is replaced with the specific subview that the action should be fired on.
Usage
add_action( 'gform_settings_gravityformswebapi', 'my_function', 10, 1 );

Parameters

$subview string
The subview of the settings page that the action is being triggered on.

Examples
function my_function() {
//Do something here
}
add_action( 'gform_settings_gravityformswebapi', 'my_function', 10, 1 );

Source Code
This action hook is located in settings.php.

gform_settings_save_button

gform_settings_save_button

DescriptionUsageParametersPlacementSource Code

Description

Filters through and allows modification of the Save button HTML for the overall Gravity Forms Settings.

Usage

sprintf( '',
esc_html( rgar( $save_props, 'value' ) ),
esc_attr( $save_props['class'] ),
! $this->is_dependency_met( rgar( $save_props, 'dependency' ) ) ? 'style="display:none;"' : ''
);

Parameters

$save_button stringThe HTML rendered for the Save button.

Placement

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

Source Code

This filter is located in GFSettings::page_header() in settings.php.