Add a custom link to the toolbar menu in Gravity Forms

Add a custom link to the toolbar menu in Gravity Forms.

Snippet Type

Execute on Child Sites

Snippet

add_filter( 'gform_toolbar_menu', 'add_custom_toolbar_menu_item', 10, 2 );
function add_custom_toolbar_menu_item( $menu, $form_id ) {

    // Add a new menu item under the Gravity Forms toolbar
    $menu[] = array(
        'name'       => 'custom_menu_item',
        'label'      => esc_html__( 'My Custom Tool', 'your-text-domain' ),
        'url'        => admin_url( 'admin.php?page=my-custom-tool' ),
        'meta'       => array(
            'title' => esc_html__( 'Go to My Custom Tool', 'your-text-domain' ),
        ),
        'capability' => 'gravityforms_edit_forms', // Only show to users with this capability
    );

    return $menu;
}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.