gform_form_notification_page

Description

Filters the form to be used in the notification page.

Usage

The following would apply to all forms:

add_filter( 'gform_form_notification_page', 'your_function_name', 10, 2 );

To target a specific form, append the form id to the hook name. (format: gform_form_notification_page_FORMID)

add_filter( 'gform_form_notification_page_1', 'your_function_name', 10, 2 );

Parameters

  • $form Form Object
    The current form.

  • $notification_id int
    The notification id.

Example

The example below assumes a master form has been created (id 79) with all the notifications needed. When going to a different form and editing a notification, all the ones from the master form will be saved to your new form. Any changes made to notifications on your new form would be overwritten by the master form’s notifications once a notification is saved. This can be used to control the notifications on forms.

add_filter( 'gform_form_notification_page', 'use_master_form', 10, 2 );
function use_master_form( $form, $notification_id ){
	if ($form['id'] == '45'){
		//use master form with notifications to be used for all forms.
		$form = GFFormsModel::get_form_meta(79);
	}

	return $form;

Placement

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

Since

This filter was added in Gravity Forms version 1.8.6.

Source Code

This filter is located in GFNotification::notification_edit_page() in notification.php.