gform_capsulecrm_opportunity

gform_capsulecrm_opportunity

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
This filter allows the Capsule CRM Opportunity object to be modified before it is created.
Usage
The following would apply to all forms:
add_filter( 'gform_capsulecrm_opportunity', 'your_function_name', 10, 4 );

To target a specific form, append the form id to the hook name. (format: gform_capsulecrm_opportunity_FORMID)
add_filter( 'gform_capsulecrm_opportunity_1', 'your_function_name', 10, 4 );

To target a specific feed for a form, append the form id and feed id to the hook name. (format: gform_capsulecrm_opportunity_FORMID_FEEDID)
add_filter( 'gform_capsulecrm_opportunity_1_7', 'your_function_name', 10, 4 );

Parameters

$opportunity array
Capsule CRM opportunity.
array (
'name' => 'Capsule CRM',
'description' => 'Test Case',
'party' =>
array (
'id' => 179884585
),
'milestone' =>
array(
'name' => 'Meeting'
),
'owner' =>
array(
'username' => 'testuser'
)
)

$form Form Object
The current form.

$entry Entry Object
The current entry.

$feed Feed Object
The current feed.

Examples
add_filter( 'gform_capsulecrm_opportunity', 'change_opportunity_object', 10, 4 );
function change_opportunity_object( $opportunity, $form, $entry, $feed ){
$opportunity['description'] = 'Opportunity Created by API';
return $opportunity;
}

Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms Capsule CRM Add-On version 1.2.
Source Code
This filter is located in GFCapsuleCRM::create_opportunity() in class-gf-capsulecrm.php.

gform_campaignmonitor_field_value

gform_campaignmonitor_field_value

DescriptionUsageParametersExamples1. Use GF_Field::get_value_export2. Change Signature ValuePlacementSource CodeSince

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

To target a specific form append the form id to the hook name. (format: gform_campaignmonitor_field_value_FORMID)
add_filter( 'gform_campaignmonitor_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_campaignmonitor_field_value_FORMID_FIELDID)
add_filter( 'gform_campaignmonitor_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. Use GF_Field::get_value_export
This example shows how you can have versions of the Campaign Monitor add-on older than 3.4 use GF_Field::get_value_export() to format the field value for export. Requires a minimum of Gravity Forms 1.9.12.4.
add_filter( 'gform_campaignmonitor_field_value', 'format_entry_value', 10, 4 );
function format_entry_value( $value, $form_id, $field_id, $entry ) {
$form = GFAPI::get_form( $form_id );
$field = GFFormsModel::get_field( $form, $field_id );

if ( is_object( $field ) ) {
$value = $field->get_value_export( $entry, $field_id, true );
}

return $value;
}

2. Change Signature Value
This example shows how you can send the url of the signature image.
add_filter( 'gform_campaignmonitor_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_campaignmonitor_field_value', array( $form['id'], $field_id ), $field_value, $form['id'], $field_id, $entry )

This filter is located in GFCampaignMonitor::maybe_override_field_value() in class-gf-campaignmonitor.php.
Since
The base filter was added in version 2.5. The form and field specific versions were added in version 3.4.

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_capsulecrm_person

gform_capsulecrm_person

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
This filter allows the Capsule CRM Person object to be modified before it is created/updated.
Usage
The following would apply to all forms:
1add_filter( 'gform_capsulecrm_person', 'your_function_name', 10, 4 );
To target a specific form, append the form id to the hook name. (format: gform_capsulecrm_person_FORMID)
1add_filter( 'gform_capsulecrm_person_1', 'your_function_name', 10, 4 );
To target a specific feed for a form, append the form id and feed id to the hook name. (format: gform_capsulecrm_person_FORMID_FEEDID)
1add_filter( 'gform_capsulecrm_person_1_7', 'your_function_name', 10, 4 );

Parameters

$person array
Capsule CRM person.
12345678910111213array (  'type' => 'person',  'firstName' => 'TestFirst',  'lastName' => 'TestLast',  'about' => "New Person created by API',  'jobTitle => '',  'emailAddress' =>     array (      array(        'address' => '[email protected]'      )    ))

$form Form Object
The current form.

$entry Entry Object
The current entry.

$feed Feed Object
The current feed.

Examples
12345add_filter( 'gform_capsulecrm_person', 'change_person_object', 10, 4 );function change_person_object( $person, $form, $entry, $feed ){    $person['about'] = 'Person Created by API';    return $person;}
Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms Capsule CRM Add-On version 1.2.
Source Code
This filter is located in GFCapsuleCRM::create_person() in class-gf-capsulecrm.php.

gform_campaignmonitor_override_blank_custom_fields

gform_campaignmonitor_override_blank_custom_fields

DescriptionUsageParametersExamples1. Override all feeds2. Override specific feedPlacementSource Code

Description
This filter can be used to modify how the add-on handles blank custom fields. The default behaviour is to remove custom fields which don』t have a value from the CustomFields array so they aren』t sent to Campaign Monitor.
Usage
The filter which would run for all Campaign Monitor feeds can be used like so:
add_filter( 'gform_campaignmonitor_override_blank_custom_fields', 'your_function_name', 10, 4 );

Parameters

$override boolean
The default is false.

$entry Entry Object
The Entry which is currently being processed.

$form Form Object
The Form which is currently being processed.

$feed Feed Object
The Feed which is currently being processed.

Examples
1. Override all feeds
The following example shows how you can apply the filter to all Campaign Monitor feeds.
add_filter( 'gform_campaignmonitor_override_blank_custom_fields', '__return_true' );

2. Override specific feed
The following example shows how you can target a specific Campaign Monitor feed.
add_filter( 'gform_campaignmonitor_override_blank_custom_fields', function ( $override, $entry, $form, $feed ) {
$feed_name = rgars( $feed, 'meta/feedName' );

return $feed_name == 'Your feed name' ? true : false;
}, 10, 4 );

Placement
Your code snippet should be placed in the functions.php file of your active theme.
Source Code
apply_filters( 'gform_campaignmonitor_override_blank_custom_fields', false, $entry, $form, $feed )

This filter is located in GFCampaignMonitor::export_feed() in class-gf-campaignmonitor.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_capsulecrm_task

gform_capsulecrm_task

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
This filter allows the Capsule CRM Task object to be modified before it is created.
Usage
The following would apply to all forms:
1add_filter( 'gform_capsulecrm_task', 'your_function_name', 10, 4 );
To target a specific form, append the form id to the hook name. (format: gform_capsulecrm_task_FORMID)
1add_filter( 'gform_capsulecrm_task_1', 'your_function_name', 10, 4 );
To target a specific feed for a form, append the form id and feed id to the hook name. (format: gform_capsulecrm_task_FORMID_FEEDID)
1add_filter( 'gform_capsulecrm_task_1_7', 'your_function_name', 10, 4 );

Parameters

$task array
Capsule CRM task.
12345678910111213141516array (  'description' => 'Capsule CRM',  'detail' => 'Task Created by API',  'lastName' => 'TestLast',  'dueOn' => '2019-02-14',  'dueTime => '21:25:08',  'status' => 'OPEN',  'category' =>       array(        'name' => 'Follow-up'      ),   'owner' =>      array(       'username' => 'testuser'     ))

$form Form Object
The current form.

$entry Entry Object
The current entry.

$feed Feed Object
The current feed.

Examples
12345add_filter( 'gform_capsulecrm_task', 'change_task_object', 10, 4 );function change_task_object( $task, $form, $entry, $feed ){    $task['description'] = 'Task Created by API';    return $task;}
Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms Capsule CRM Add-On version 1.2.
Source Code
This filter is located in GFCapsuleCRM::create_task() in class-gf-capsulecrm.php.

gform_agilecrm_tags

gform_agilecrm_tags

DescriptionUsageParametersExamples1. Always add tags2. Add tag depending on field valuePlacementSource Code

Description
This filter is used to dynamically alter the tags to be assigned to a contact in Agile CRM.
Usage
The following would apply to all feeds:
add_filter( 'gform_agilecrm_tags', 'your_function_name', 10, 4 );

To target feeds for a specific form append the form id to the hook name. (format: gform_agilecrm_tags_FORMID)
add_filter( 'gform_agilecrm_tags_4', 'your_function_name', 10, 4 );

Parameters

$tags array
An array of tags to be assigned to the contact.

$feed Feed Object
The feed currently being processed.

$entry Entry Object
The entry currently being processed.

$form Form Object
The form currently being processed.

Examples
1. Always add tags
This example shows how you can add a new tag.
add_filter( 'gform_agilecrm_tags', 'add_new_tag', 10, 4 );
function add_new_tag( $tags, $feed, $entry, $form ) {
$tags[] = 'some tag';

return $tags;
}

2. Add tag depending on field value
This example shows how you can add a tag depending on an entry field value.
add_filter( 'gform_agilecrm_tags', 'add_new_tag', 10, 4 );
function add_new_tag( $tags, $feed, $entry, $form ) {
$product = rgar( $entry, '15' );

if ( $product != 'gravityforms' ) {
$tags[] = 'some tag';
}

return $tags;
}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
gf_apply_filters( 'gform_agilecrm_tags', $form['id'], $tags, $feed, $entry, $form );

This filter is located in the following methods in class-gf-agilecrm.php:

GFAgileCRM::create_contact()
GFAgileCRM::update_contact()

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_authorizenet_form_data

gform_authorizenet_form_data

DescriptionUsageParametersExamples1. Change fee_amountPlacementSource Code

Description
This filter can be used to modify the form submission data before it is used to create the Authorize.net transaction.

This hook has been deprecated. Please use gform_submission_data_pre_process_payment instead.

Usage
The filter which would run for all Authorize.net feeds can be used like so:
add_filter( 'gform_authorizenet_form_data', 'your_function_name', 10, 4 );

You can also target a specific form by appending the form id on the end of the hook name like so:
add_filter( 'gform_authorizenet_form_data_4', 'your_function_name', 10, 4 );

Parameters

$form_data Form Data
An associative array containing the form title, billing address, payment amount, setup fee amount, line items created using the submitted pricing field values and any discounts from coupons.

$form Form Object
The form which is currently being processed.

$config Authorize Net Config
The feed which is currently being processed.

Examples
1. Change fee_amount
The following example shows how you can change the setup fee depending on the value of a form field.
add_filter( 'gform_authorizenet_form_data', function ( $form_data, $form, $config ) {
if ( rgpost( 'input_1' ) == 'some value' ) {
$form_data['fee_amount'] = 0;
}

return $form_data;
}, 10, 4 );

Placement
Your code snippet should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GFAuthorizeNet::get_form_data() in authorizenet.php.