Advertisement:

Author Topic: How can i add a custom submenu in admin toolbar?  (Read 185 times)

d3sign3r

  • Newbie
  • *
  • Posts: 43
How can i add a custom submenu in admin toolbar?
« on: January 20, 2019, 05:17:17 pm »
Hi i added some custom links in admin toolbar and now i want to add a submenu to one of them. To create a new link in toolbar i created a new function like that:

Code: [Select]
function osc_admin_toolbar_menu_dash()
{
    AdminToolbar::newInstance()->add_menu( array(
                'id'        => 'dash',
                'title'     => __('Dash'),
                'href'      => osc_admin_base_url(), 'dash', 'moderator',
                'meta'      => array('class' => 'user-profile'),
                'target'    => '_self'
            ) );
}

and then i added the code :

Code: [Select]
osc_add_hook( 'add_admin_toolbar_menus', 'osc_admin_toolbar_menu_dash'    , 0 );
in the AdminToolbar class file.

And i created a the link "Dash" in the admin top Toolbar. So far so good. My question is how can i add a dropdown submenu  with 2-3 links in the newly custom created "Dash" link? I dont want to do that using a plugin.

Please somebody help !!!!!!!!!!!