gform_author_dropdown_args

gform_author_dropdown_args

DescriptionUsageParametersExamplesPlacementSource Code

Description
This filter is executed when the form editor is loaded, when creating the author drop down selection for the Post Fields. Use this hook to change the list of authors displayed in the drop down by filtering the $args parameter to be passed to the wp_dropdown_users( $args ) function.
Usage
Applies to all forms:
1add_filter( 'gform_author_dropdown_args', 'set_users' );
Applies to a specific form. In this case, form Id 5:
1add_filter( 'gform_author_dropdown_args_5', 'set_users' );
Parameters

$args array
The args to be filtered, in the format expected by the wp_dropdown_users() WordPress function.

Examples
This example changes the author drop down so that it includes two users (Ids 1 and 8):
12345add_filter( 'gform_author_dropdown_args', 'set_users' );function set_users( $args ) {    $args['include'] = '1,8';    return $args;}
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in form_detail.php.

gform_authorizenet_amount_pre_authorize

gform_authorizenet_amount_pre_authorize

DescriptionUsageParametersExamplePlacementSource Code

Description
This filter can be used to modify the authorization amount before it is sent to Authorize.net.
Usage
The filter which would run for all 『product and services』 type Authorize.net feeds can be used like so:
1add_filter( 'gform_authorizenet_amount_pre_authorize', 'your_function_name', 10, 6 );

Parameters

$auth_amount float
The authorization amount. Defaults to value of $config[『amount』].

$transaction object
The Authorize.net transaction object.

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

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

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

$entry Entry Object
The entry which is currently being processed. Since version 2.1.8.

Example
The following example shows how you can override the authorization amount.
12345678add_filter( 'gform_authorizenet_amount_pre_authorize', 'change_amount', 10, 4 );function change_amount( $auth_amount, $transaction, $form_data, $config, $form ) {    if ( $form['id'] == 10 ) {        $auth_amount = 1;    }     return $auth_amount;}
Placement
Your code snippet should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GFAuthorizeNet::authorize() in class-gf-authorizenet.php.

gform_{$SHORT_SLUG}_field_value

gform_{$SHORT_SLUG}_field_value

DescriptionShort Slug ValuesUsageParametersExamples1. ActiveCampaign – Use Choice Text Instead of Value2. ActiveCampaign – Replace Commas with Pipes3. Emma – Format Checkbox Field4. Help Scout – Change Value of Specific Field5. Zoho CRM – Format Date Field6. Zoho CRM – Format Checkbox FieldPlacementSinceSource Code

Description
This filter can be used to modify a value before it is sent to a third-party by one of the Add-On Framework based add-ons. If you want to filter the value for any add-on you can use gform_addon_field_value.
Short Slug Values
The Gravity Forms Add-On Slugs article lists the available short slugs to use with this hook:
The following add-ons listed in the slug article do not use the hook:

Gravity Forms CLI Add-On
Gravity Forms Debug Add-On
Gravity Forms Gutenberg Add-On

The Zapier Add-On implements its own version of the hook:

gform_zapier_field_value

Usage
The base filter which would run for all forms and all fields would be used like so:
1add_filter( 'gform_helpscout_field_value', 'your_function_name', 10, 4 );
To target a specific form append the form id to the hook name. (format: gform_{$SHORT_SLUG}_field_value_FORMID)
1add_filter( 'gform_helpscout_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_{$SHORT_SLUG}_field_value_FORMID_FIELDID)
1add_filter( 'gform_helpscout_field_value_10_3', 'your_function_name', 10, 4 );

Parameters

$value string
The value to be modified.

$form Form Object
The form currently being processed.

$entry Entry Object
The entry currently being processed.

$field_id string
The ID of the field currently being processed.

Examples
1. ActiveCampaign – Use Choice Text Instead of Value
This example shows how you can replace the value of a choice based survey field with the choice text.
1234567891011add_filter( 'gform_activecampaign_field_value', 'gf_get_choice_text', 10, 4 );function gf_get_choice_text( $value, $form, $entry, $field_id ) {    gf_activecampaign()->log_debug( __METHOD__ . '(): running.' );    $field = GFAPI::get_field( $form, $field_id );     if ( is_object( $field ) && $field->type == 'survey' ) {        $value = $field->get_value_export( $entry, $field_id, true );        gf_activecampaign()->log_debug( __METHOD__ . '(): Value: ' . $value );    }    return $value;}
2. ActiveCampaign – Replace Commas with Pipes
This example shows how you can replace the commas used to separate checkbox or multi select choices with pipe characters.
123456789101112add_filter( 'gform_activecampaign_field_value', 'gf_replace_commas_with_pipes', 10, 4 );function gf_replace_commas_with_pipes( $value, $form, $entry, $field_id ) {    gf_activecampaign()->log_debug( __METHOD__ . '(): running.' );    $field = GFAPI::get_field( $form, $field_id );     if ( is_object( $field ) && ( $field->type == 'checkbox' || $field->type == 'multiselect' ) ) {        $value = str_replace( ', ', '||', $value );        gf_activecampaign()->log_debug( __METHOD__ . '(): Value: ' . $value );    }     return $value;}
3. Emma – Format Checkbox Field
This example shows how you can reformat the checkbox field value to be passed as an array instead of a string.
123456789add_filter( 'gform_emma_field_value', function ( $value, $form, $entry, $field_id ) {    $field = GFAPI::get_field( $form, $field_id );     if ( is_object( $field ) && $field->get_input_type() === 'checkbox' ) {        $value = explode( ', ', $value );    }     return $value;}, 10, 4 );
4. Help Scout – Change Value of Specific Field
This example shows how you can change the value of field 3 on form 10 before it is passed to Help Scout.
1234add_filter( 'gform_helpscout_field_value_10_3', function ( $value, $form, $entry, $field_id ) {     return 'your new value';}, 10, 4 );
5. Zoho CRM – Format Date Field
This example shows how you can reformat the entry date from yyyy-mm-dd to the format configured on the field.
123456789add_filter( 'gform_zohocrm_field_value', function ( $value, $form, $entry, $field_id ) {    $field = GFAPI::get_field( $form, $field_id );     if ( is_object( $field ) && $field->type == 'date' ) {        $value = GFCommon::date_display( $value, $field->dateFormat );    }     return $value;}, 10, 4 );
6. Zoho CRM – Format Checkbox Field
This example shows how you can reformat the checkbox field value to pass true or false instead of the choice. This snippet is not needed if you』re using version 1.8 of the add-on or newer.
1234567891011add_filter( 'gform_zohocrm_field_value', function ( $value, $form, $entry, $field_id ) {    gf_zohocrm()->log_debug( __METHOD__ . '(): Running...' );    $field = GFAPI::get_field( $form, $field_id );     if ( is_object( $field ) && $field->get_input_type() === 'checkbox' ) {        gf_zohocrm()->log_debug( __METHOD__ . '(): Checkbox value to true or false.' );        $value = $value ? 'true' : 'false';    }     return $value;}, 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 1.9.10.11.
Source Code
1234gf_apply_filters( "gform_{$slug}_field_value", array(    $form['id'],    $field_id), $field_value, $form, $entry, $field_id );
This filter is located in GFAddOn::maybe_override_field_value() in includes/addon/class-gf-addon.php.

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.

gform_authorizenet_post_capture

gform_authorizenet_post_capture

DescriptionUsageParametersExamplesPlacementSource Code

Description
Action hook used by Authorize.Net that fires after the payment has been captured.
Usage
add_action( 'gform_authorizenet_post_capture', 'your_function_name', 10, 6 )

Parameters

$is_authorized bool
Indicates if the payment was authorized.

$amount string
The payment amount captured.

$entry Entry Object
The current entry.

$form Form Object
The current form.

$config Feed Object
The feed configuration.

$response object
The capture response from Authorize.Net.

Examples
add_action( 'gform_authorizenet_post_capture', 'notify_of_capture', 10, 6 );
function notify_of_capture( $is_authorized, $amount, $entry, $form, $config, $response ){
GFCommon::send_email( '[email protected]', '[email protected]','','','testing', 'Funds were captured.');
}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GFAuthorizeNet::process_capture() in gravityformsauthorizenet/class-gf-authorizenet.php.