gform_form_settings_menu

Description

Add new or modify default menu items which will appear in the Form Settings section menu.

Usage

add_filter( 'gform_form_settings_menu', 'my_custom_function' );

Parameters

  • $menu_items array
    An array of menu items to be displayed on the Form Settings page menu.

Examples

This example demonstrates how you can add a custom menu item to the Form Settings page menu. It also demonstrates (with the use of the gform_form_settings_page_view) how to display content for this page when selected.

// 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' ),
        'icon' => 'dashicons-flag dashicons'
        );
 
    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();
 
}

Source Code

This filter is located in GFFormSettings::get_tabs() in form_settings.php.