How to Add Admin Toolbar Menu link
Code in Functions File :
If you’d like, you can also add new links to your admin toolbar menu by inserting code into your functions.php file.
You will just need to fill in the code with your own information in various places where required.
#functions.php
add_action('admin_bar_menu', 'add_toolbar_items', 100);
function add_toolbar_items($admin_bar){
$menu_id = 'top-menu-create';
$admin_bar->add_menu( array(
'id' => $menu_id,
'title' => '<span class="ab-icon dashicons-before dashicons-admin-generic"></span> Barfia setting',
'href' => get_admin_url().'admin.php?page=barfia-setting',
'meta' => array(
'title' => __('Barfia setting'),
),
));
$admin_bar->add_menu(array('parent' => $menu_id, 'title' => __('Testing'), 'id' => 'dwb-drafts', 'href' => 'edit.php'));
$admin_bar->add_menu(array('parent' => $menu_id, 'title' => __('Testing Comments'), 'id' => 'dwb-pending', 'href' => 'edit-comments.php'));
}