Using Gravity Forms ‘gform_addon_navigation’ PHP filter

The gform_addon_navigation filter allows you to add a sub-menu item under the “Forms” menu in Gravity Forms.

Usage

add_filter('gform_addon_navigation', 'add_menu_item');

Parameters

  • $menu_items (array): The current list of menu items to be filtered, in the following format:
    array(
        array(
            "name" => "gf_campaignmonitor",
            "label" => "Campaign Monitor",
            "callback" => "campaignmonitor_page",
            "permission" => "gravityforms_campaignmonitor"
        )
    );
    

More information

See Gravity Forms Docs: gform_addon_navigation

Examples

Add a new sub-menu item under “Forms”

This code adds a new sub-menu item under the “Forms” menu in Gravity Forms.

add_filter('gform_addon_navigation', 'add_menu_item');

function add_menu_item($menu_items) {
    $menu_items[] = array(
        "name" => "new_submenu_name",
        "label" => "New Submenu",
        "callback" => "submenu_handler",
        "permission" => "edit_posts"
    );
    return $menu_items;
}

Add a “Reports” sub-menu item

This code adds a “Reports” sub-menu item under the “Forms” menu in Gravity Forms.

add_filter('gform_addon_navigation', 'add_reports_menu_item');

function add_reports_menu_item($menu_items) {
    $menu_items[] = array(
        "name" => "gf_reports",
        "label" => "Reports",
        "callback" => "reports_page_handler",
        "permission" => "edit_posts"
    );
    return $menu_items;
}

Add a “Settings” sub-menu item

This code adds a “Settings” sub-menu item under the “Forms” menu in Gravity Forms.

add_filter('gform_addon_navigation', 'add_settings_menu_item');

function add_settings_menu_item($menu_items) {
    $menu_items[] = array(
        "name" => "gf_settings",
        "label" => "Settings",
        "callback" => "settings_page_handler",
        "permission" => "manage_options"
    );
    return $menu_items;
}

Add a “Help” sub-menu item

This code adds a “Help” sub-menu item under the “Forms” menu in Gravity Forms.

add_filter('gform_addon_navigation', 'add_help_menu_item');

function add_help_menu_item($menu_items) {
    $menu_items[] = array(
        "name" => "gf_help",
        "label" => "Help",
        "callback" => "help_page_handler",
        "permission" => "edit_posts"
    );
    return $menu_items;
}

Add a “Custom Integrations” sub-menu item

This code adds a “Custom Integrations” sub-menu item under the “Forms” menu in Gravity Forms.

add_filter('gform_addon_navigation', 'add_custom_integrations_menu_item');

function add_custom_integrations_menu_item($menu_items) {
    $menu_items[] = array(
        "name" => "gf_custom_integrations",
        "label" => "Custom Integrations",
        "callback" => "custom_integrations_page_handler",
        "permission" => "manage_options"
    );
    return $menu_items;
}