Description
The gform_form_settings_page_{VIEW} action allows developers to add custom pages (i.e. “views”) to the Form Settings section. This hook is used by Gravity Forms add-ons to add their settings pages.
Usage
Specify the view name after the gform_form_settings_page_ part of the hook name.
add_action( 'gform_form_settings_page_VIEW', 'my_custom_function' );
Parameters
There are no parameters for this action.
Examples
Display page content for a custom Form Settings menu item.
This example demonstrates how to display page content for menu items added via the gform_form_settings_menu filter using the gform_form_settings_page_{VIEW} hook. Note that the VIEW in the hook name is variable and should be replaced by your page name.
// add a custom menu item to the Form Settings page menu
add_filter( 'gform_form_settings_menu', 'my_custom_form_settings_menu_item' );
function my_custom_form_settings_menu_item( $menu_items ) {
$menu_items[] = array(
'name' => 'my_custom_form_settings_page',
'label' => __( 'My Custom Form Settings Page' )
);
return $menu_items;
}
// handle displaying content for our custom menu when selected
add_action( 'gform_form_settings_page_my_custom_form_settings_page', 'my_custom_form_settings_page' );
function my_custom_form_settings_page() {
GFFormSettings::page_header();
echo 'My Custom Form Settings!';
GFFormSettings::page_footer();
}
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?
Source Code
This action is located in GFFormSettings::form_settings_page() in form_settings.php.