gform_breeze_card

gform_breeze_card

DescriptionUsageParametersExamplesSource Code

Description
The 「gform_breeze_card」 filter in the Gravity Breeze Add-On filters which card is created by the add-on.
Usage
add_filter( 'gform_breeze_card', 'my_function', 10, 4 );

Parameters

$card array
The card that is being filtered.

$feed array
The feed object.

$entry array
The entry object.

$form array
The form object.

Examples
function my_function( $card, $feed, $entry, $form ) {
//Do something here
return $card;
}
add_filter( 'gform_breeze_card', 'my_function', 10, 4 );

Source Code
This filter is located in class-gf-breeze.php.

gform_block_form_forms

gform_block_form_forms

DescriptionUsageParametersExamples1. Remove2. Sort list newest to oldestPlacementSinceSource Code

Description

The gform_block_form_forms filter allows the list of available forms displayed in the Form block to be overridden.

Usage

The filter would be used like so:

add_filter( 'gform_block_form_forms', 'your_function_name' );

Parameters

$forms arrayA collection of active forms on site. The array for each form contains the following properties: id, title, and hasConditionalLogic. As of Gravity Forms 2.5, this array is sorted alphabetically by title. It was previously sorted incrementally by id.

Examples

1. Remove

This example removes form id 1 from the list of forms which can be embedded using the Form block in the WordPress block editor.

add_filter( 'gform_block_form_forms', function ( $forms ) {

foreach ( $forms as $key => $form ) {
if ( $form['id'] == 1 ) {
unset( $forms[ $key ] );
break;
}
}

return array_values( $forms );

} );

2. Sort list newest to oldest

This example sorts the list of forms with most recent forms listed at the the top. (requires PHP 7 or greater)

add_filter( 'gform_block_form_forms', function ( $forms ) {

usort( $forms, function( $a, $b ) {
return $b['id'] <=> $a['id'];
});

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 GF_Block_Form::get_forms() in includes/blocks/class-gf-block-form.php.

gform_before_resend_notifications

gform_before_resend_notifications

DescriptionUsageParametersExamplesPlacementSource Code

Description
This filter is executed before resending notifications from the admin. You may use this to modify the form object. This is especially useful in changing the email subject or message.
Usage
Applies to all forms
1add_filter( 'gform_before_resend_notifications', 'change_subject', 10, 2 );
Applies to a specific form. In this case, form Id 5.
1add_filter( 'gform_before_resend_notifications_5', 'change_subject', 10, 2 );

Parameters

$form Form Object
The form from which the entry value was submitted.

$lead_ids array
An array of entry ids.

Examples
This example changes the subject line of the email.
123456add_filter( 'gform_before_resend_notifications', 'change_subject', 10, 2 );function change_subject( $form, $lead_ids ) {    $original_subject = $form['notification']['subject'];    $form['notification']['subject'] = 'Resending - ' . $original_subject;    return $form;}
Placement
This code should be placed in the functions.php file of your active theme
Source Code
This filter is located in GFForms::resend_notifications() in gravityforms.php

gform_before_delete_form

gform_before_delete_form

DescriptionUsageParametersExamplesSource Code

Description
Use this action hook to perform actions right before a form is deleted.
Usage
add_action( 'gform_before_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.
add_action( 'gform_before_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();

$entry_count = RGFormsModel::get_lead_count( $form_id, '' );

fwrite( $f, date( 'c' ) . " - Form deleted by {$user->user_login}. Form ID: {$form_id}. Entries: {$entry_count} n");
fclose( $f );
}

Source Code
This action hook is located in GFFormsModel::delete_form() in form_model.php.

gform_before_delete_field

gform_before_delete_field

DescriptionUsageParametersExamplesSource Code

Description
Use this action hook to perform actions right before a field is deleted from a form.
Usage
add_action( 'gform_before_delete_field', 'do_cleanup', 10, 2 );

Parameters

$form_id integer
ID of current form.

$field_id integer
ID of deleted field.

Examples
This example adds a log file entry when a field is deleted.
add_action( 'gform_before_delete_field', 'log_field_deleted', 10, 2 );
function log_field_deleted( $form_id, $field_id ) {
$log_file = ABSPATH . '/gf_deleted_fields.log';
$f = fopen( $log_file, 'a' );
$user = wp_get_current_user();
$form = GFAPI::get_form( $form_id );
$field = RGFormsModel::get_field( $form, $field_id );

fwrite( $f, date( 'c' ) . " - Field deleted by {$user->user_login}. Form ID: {$form_id}. Field: {$field["label"]} (ID: {$field_id}) n" );
fclose( $f );
}

Source Code
This action hook is located in GFFormsModel::delete_field() in form_model.php.

gform_aweber_post_subscriber_created

gform_aweber_post_subscriber_created

DescriptionUsageParametersExamples1. Store a property in the entry metaPlacementSinceSource Code

Description
The gform_aweber_post_subscriber_created hook can be used to perform custom actions after the subscriber has been successfully added to the AWeber list.
Usage
The hook which would run for all AWeber feeds can be used like so:
add_filter( 'gform_aweber_post_subscriber_created', 'your_function_name', 10, 4 );

Parameters

$subscriber array
An associative array containing the subscriber properties returned by AWeber in the response to the create request.

$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. Store a property in the entry meta
The following example shows how you can store the value from one of the subscriber properties in the entry meta.
add_action( 'gform_aweber_post_subscriber_created', function ( $subscriber, $form, $entry, $feed ) {
gform_update_meta( $entry['id'], 'aweber_subscriber_status', rgar( $subscriber, 'status' ) );
}, 10, 4 );

Placement
Your code snippet should be placed in the functions.php file of your active theme.
Since
This hook was added in AWeber version 2.4.1.
Source Code
This filter is located in GFAWeber::export_feed() in class-gf-aweber.php.

gform_aweber_field_value

gform_aweber_field_value

DescriptionUsageParametersExamples1. Change Signature ValuePlacementSource CodeSince

Description
This filter can be used to modify a value before it is sent to AWeber.
Usage
The base filter which would run for all forms and all fields would be used like so:
add_filter( 'gform_aweber_field_value', 'your_function_name', 10, 4 );

To target a specific form append the form id to the hook name. (format: gform_aweber_field_value_FORMID)
add_filter( 'gform_aweber_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_aweber_field_value_FORMID_FIELDID)
add_filter( 'gform_aweber_field_value_10_3', 'your_function_name', 10, 4 );

Parameters

$value string
The value to be modified.

$form_id integer
The ID of the form being processed.

$field_id string
The ID of the field being processed.

$entry Entry Object
The entry currently being processed.

Examples
1. Change Signature Value
This example shows how you can send the url of the signature image.
add_filter( 'gform_aweber_field_value', 'change_signature_value', 10, 4 );
function change_signature_value( $value, $form_id, $field_id, $entry ) {
$form = GFAPI::get_form( $form_id );
$field = GFFormsModel::get_field( $form, $field_id );

if ( is_object( $field ) && $field->get_input_type() == 'signature' ) {
$value = RGFormsModel::get_upload_url_root() . 'signatures/' . $value;
}

return $value;
}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
gf_apply_filters( 'gform_aweber_field_value', array( $form['id'], $field_id ), $field_value, $form['id'], $field_id, $entry )

This filter is located in GFAWeber::maybe_override_field_value() in class-gf-aweber.php.
Since
The base filter was added in version 2.0. The form and field specific versions of this filter were added in version 2.3.

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_aweber_ad_tracking

gform_aweber_ad_tracking

DescriptionUsageParametersExamplePlacementSource Code

Description
This filter can be used to modify the ad_tracking parameter value before it is sent to AWeber.
Usage
The filter which would run for all AWeber feeds can be used like so:
add_filter( 'gform_aweber_ad_tracking', '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_ad_tracking_5', 'your_function_name', 10, 4 );

Parameters

$ad_tracking string
The default value of the ad_tracking parameter is the form title.

$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.

Example
The following example shows how you can change the parameter value.
add_filter( 'gform_aweber_ad_tracking', function ( $ad_tracking, $form, $entry, $feed ) {

return 'your new value';
}, 10, 4 );

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

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