Using Gravity Forms ‘gform_form_settings_menu’ PHP filter

The gform_form_settings_menu filter allows you to add new or modify default menu items that 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.

More information

See Gravity Forms Docs: gform_form_settings_menu

Examples

Add a custom menu item to the Form Settings page menu

This example demonstrates how to add a custom menu item to the Form Settings page menu and 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();
}