To add a new menu/tab to the WordPress toolbar, you need to simply copy and paste the following code in your theme’s functions.php file.

add_action( 'admin_bar_menu', 'add_toolbar_link_top', 999 );
function add_toolbar_link_top( $wp_admin_bar ) 
{	
	$args = array(
		'id'    => 'your-id',
		'title' => 'Your Title',
		'href'  => site_url(),
		'meta'  => array( 'class' => 'your-class-name' )
	);
	$wp_admin_bar->add_node( $args );
}

This code will add new menu in WordPress toolbar.

Have any doubt, then comment here!

Leave a Reply

Your email address will not be published. Required fields are marked *