Admin bar generator

Home » WordPress Generators » Admin bar generator
The name of the function that will be created.
The text domain of the plugin.
The ID of the menu that will be created.
The name of the menu that will be created.
The href of the menu item.
The ID of the parent menu item.
The class of the menu item.
Group Menu (optional)
Create a group node for the menu. See the add_group method first if you want to group menus.
The HTML code to render this menu item.
Value for target attribute of the menu item.
The title attribute of the menu item.
The onClick attribute of the menu item.
The tab index of the menu item.
                    // Register your menus to the admin toolbar.
function wpturbo_register_my_custom_admin_menu() {
	global $wp_admin_bar;

	$args = array(
		'id'     => 'wpturbo-custom-menu',
		'title'  => __( 'My Menu', 'wpturbo' ),
		'meta'   => array(
		),
	);
	$wp_admin_bar->add_menu($args);
}
add_action( 'wp_before_admin_bar_render', 'wpturbo_register_my_custom_admin_menu', 999 );