gform_notification_ui_settings

gform_notification_ui_settings

DescriptionUsageParametersExamplesAdd a new settingRemove existing settingSource Code

Description
Add new or modify existing notification settings that display on the Notification Edit screen.
Usage
The following would apply to all forms.
1add_filter( 'gform_notification_ui_settings', 'your_function_name', 10, 3 );
To limit the scope of your function to a specific form, append the form id to the end of the hook name. (format: gform_notification_ui_settings_FORMID)
1add_filter( 'gform_notification_ui_settings_5', 'your_function_name', 10, 3 );

Parameters

$ui_settings array
An array of settings for the notification UI. Each setting contains the HTML which will be displayed for that setting.

$confirmation array
An array of properties which make up the current notification object to be edited. See Notifications Object for default properties.

$form Form Object
The current form object to which the notification being edited belongs.

Examples
Add a new setting
This example demonstrates how you can add a custom notification UI setting. Use with the gform_pre_notification_save hook to add the submitted value of your setting to the notification object. Use with the gform_notification_validation hook to ensure the value submitted for your setting is valid.
1234567891011add_filter( 'gform_notification_ui_settings', 'my_custom_notification_setting', 10, 3 );function my_custom_notification_setting( $ui_settings, $notification, $form ) {     $ui_settings['my_custom_setting'] = '        

            

            

        

';     return $ui_settings;}
Remove existing setting
The following example shows how to remove the From Email setting.
123456add_filter( 'gform_notification_ui_settings', 'remove_from_email_from_settings', 10, 3 ); function remove_from_email_from_settings( $ui_settings, $notification, $form ) {    unset ( $ui_settings['notification_from'] );    return $ui_settings;}
Source Code
This filter is located in GFNotification::get_notification_ui_settings() in notification.php

發表回覆

您的郵箱地址不會被公開。 必填項已用 * 標註