gform_notification_enable_cc

gform_notification_enable_cc

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
The 「gform_notification_enable_cc」 filter allows the display of a carbon copy field when creating a notification.
Usage
The following would apply to all forms:
1add_filter('gform_notification_enable_cc', 'your_function_name', 10, 3 );
To target a specific form, append the form id to the hook name. (format: gform_notification_enable_cc_FORMID)
1add_filter('gform_notification_enable_cc_21', 'your_function_name', 10, 3 );
To target a specific form and notification, append the form id and notification id to the hook name. (format: gform_notification_enable_cc_FORMID_NOTIFICATIONID)
NOTE: The notification id may be found in the browser URL as the value for 「nid」.
1add_filter('gform_notification_enable_cc_21_5ade0502ec70f', 'your_function_name', 10, 3 );

Parameters

$enable_cc bool
Indicates if the the CC (carbon copy) field should be displayed.

$notification Notifications Object
The current notification object.

$form Form Object
The form object.

Examples
12345add_filter('gform_notification_enable_cc', 'enable_cc', 10, 3 ); function enable_cc( $enable, $notification, $form ){  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 version 2.3
Source Code
This filter is located in GFCommon::send_notification() in common.php and GFNotification::get_notification_ui_settings() in notification.php

gform_notification_disable_from_warning

gform_notification_disable_from_warning

DescriptionUsageParametersExamplePlacementSinceSource Code

Description
Allows the from address warning to be disabled.
Usage
1add_filter( 'gform_notification_disable_from_warning', '__return_true' );

Parameters

$disable_from_warning bool
Should the From Email warning be disabled?

Example

Disable the warning message for all the notifications.

1add_filter( 'gform_notification_disable_from_warning', '__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 v2.4.13.
Source Code
This filter is located in notifications.php.
1$disable_from_warning = gf_apply_filters( array( 'gform_notification_disable_from_warning', $form['id'], rgar( $notification, 'id' ) ), false );

gform_notification_actions

gform_notification_actions

DescriptionUsageParametersExamplesSource Code

Description
Modify the list of actions which display below the Notification Name on the Notifications list view.
Usage
1add_filter( 'gform_notification_actions', 'my_custom_function' );
Parameters

$actions array
An array of current notification actions.

Examples
This example demonstrates how you can add custom notification actions. Please note: the myCustomDuplicateNotificationFunction() does not exist so the form will not actually be duplicated if you add this code sample.
12345678add_filter( 'gform_notification_actions', 'my_custom_notification_action' );function my_custom_notification_action( $actions ) {     // adds a 'duplicate' action with a link that triggers some functionality on click    $actions['duplicate'] = 'Duplicate';     return $actions;}
Source Code
This filter is located in GFNotificationTable::column_name() in notification.php

gform_noconflict_styles

gform_noconflict_styles

DescriptionUsageParametersExamplesPlacementSource Code

Description
When Gravity Forms is running with no-conflict mode enabled, it prevents any unknown styles to be enqueued in the form editor page.
Use this filter to 「register」 your css file with Gravity Forms, making sure it gets enqueued in the form editor page when no-conflict mode is enabled.
Usage
add_filter( 'gform_noconflict_styles', 'register_style' );

Parameters

$styles array
An array of style handles to be filtered. Add styles to this array to register them (i.e. $styles[] = 『my-style-handle』;).

Examples
This example registers a custom style with Gravity Forms:
add_action( 'admin_head', 'enqueue_form_editor_style' );
function enqueue_form_editor_style(){

if ( RGForms::is_gravity_page() ) {
//enqueing my style on gravity form pages
wp_enqueue_style( 'my_style', plugins_url( 'my-style.css', 'my-plugin' ) );
}
}

add_filter( 'gform_noconflict_styles', 'register_style' );
function register_style( $styles ) {

//registering my style with Gravity Forms so that it gets enqueued when running on no-conflict mode
$styles[] = 'my_style';
return $styles;
}

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

gform_noconflict_scripts

gform_noconflict_scripts

DescriptionUsageParametersExamplesPlacementSource Code

Description
When Gravity Forms is running with no-conflict mode enabled, it prevents any unknown scripts to be enqueued in the form editor page.
Use this filter to 「register」 your script with Gravity Forms, making sure it gets enqueued in the form editor page when no-conflict mode is enabled.
Usage
add_filter( 'gform_noconflict_scripts', 'register_script' );

Parameters

$scripts array
An array of script handles to be filtered. Add scripts to this array to register them, (i.e. $scripts[] = 『my-script-handle』;).

Examples
This example registers a custom script with Gravity Forms:
add_action( 'admin_enqueue_scripts', 'enqueue_form_editor_script' );
function enqueue_form_editor_script() {

if ( RGForms::is_gravity_page() ) {
//enqueing my script on gravity form pages
wp_enqueue_script( 'my_script', plugins_url( 'my-script.js', 'my-plugin' ) );
}
}

add_filter( 'gform_noconflict_scripts', 'register_script' );
function register_script( $scripts ) {

//registering my script with Gravity Forms so that it gets enqueued when running on no-conflict mode
$scripts[] = 'my_script';
return $scripts;
}

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

gform_next_button

gform_next_button

DescriptionUsageParametersExamplesChange input to buttonAppend a JavaScript action to the buttonSource Code

Description
The 「gform_next_button」 filter allows the markup for the next button to be changed, giving the user control over how it looks.
Usage
Apply to all forms.
1add_filter( 'gform_next_button', 'my_next_button_markup', 10, 2 );
Apply to a specific form.
1add_filter( 'gform_next_button_10', 'my_next_button_markup', 10, 2 );
Parameters

$next_button string
The default markup for the next button.

$form Form Object
The current form.

Examples
Change input to button
This example changes the default input type to use the button element with an included span, popular for implementing the Sliding Door CSS technique.
1234add_filter( 'gform_next_button', 'form_next_button', 10, 2 );function form_next_button( $button, $form ) {    return "";}
Note: The above is just a quick example showing how to use the filter. Using the above code will prevent the form submitting as the onclick attribute is missing.
Here』s another example which would change all the next, previous, and submit buttons so they use button elements from a single function while maintaining attributes such as onclick from original inputs.
1234567891011121314151617181920212223242526/** * Filters the next, previous and submit buttons. * Replaces the forms buttons with

gform_name_suffix

gform_name_suffix

DescriptionUsageParametersExamplesSource Code

Description
This filter is executed when creating the name suffix field and can be used to modify the 「Suffix」 label.
Usage
add_filter( 'gform_name_suffix', 'change_suffix', 10, 2 );

Parameters

$label string
The label to be filtered.

$form_id integer
The id of the current form.

Examples
This example changes the default name suffix label:
add_filter( 'gform_name_suffix', 'change_suffix', 10, 2 );
function change_suffix( $label, $form_id ) {
return "Name Suffix";
}

Source Code
This filter is located in js.php and GF_Field_Name::get_field_input() in includes/fields/class-gf-field-name.php.

gform_name_prefix

gform_name_prefix

DescriptionUsageParametersExamplesSource Code

Description
This filter is executed when creating the name prefix field and can be used to modify the 「Prefix」 label.
Usage
Applies to all forms.
1add_filter( 'gform_name_prefix', 'change_prefix', 10, 2 );
Applies to a specific form. In this case, form id 5.
1add_filter( 'gform_name_prefix_5', 'change_prefix', 10, 2 );
Parameters

$label string
The label to be filtered.

$form_id integer
The id of the current form.

Examples
This example changes the default name prefix label:
1234add_filter( 'gform_name_prefix', 'change_name_prefix', 10, 2 );function change_name_prefix( $label, $form_id ) {    return "Name Prefix";}
Source Code
This filter is located in js.php and GF_Field_Name::get_field_input() in includes/fields/class-gf-field-name.php.

gform_name_last

gform_name_last

DescriptionUsageParametersExamplesSource Code

Description
This filter is executed when creating the last name field and can be used to modify the 「Last」 label.
Usage
add_filter( 'gform_name_last', 'change_last', 10, 2 );

Parameters

$label string
The label to be filtered.

$form_id integer
The id of the current form.

Examples
This example changes the default last name label:
add_filter( 'gform_name_last', 'change_last', 10, 2 );
function change_last( $label, $form_id ) {
return "Last Name";
}

Source Code
This filter is located in js.php and GF_Field_Name::get_field_input() in includes/fields/class-gf-field-name.php.