General Menu 1 Meta 1 Menu 2 Meta 2 Menu 3 Meta 3 Menu 4 Meta 4 Menu 5 Meta 5 Overview Use this tool to create custom code for Toolbar (previously known as Admin Bar) with WP_Admin_Bar class. Usage Fill in the user-friendly form. Click the “Update Code” button. Copy the code to your project. Or save it as a snippet and share with the community. Examples If you are still learning how to use this tool, check out the following examples: Toolbar link Toolbar submenu Toolbar with attributes Function Name The function used in the code. Text Domain Translation file Text Domain. Optional. Toolbar 1 ID The ID of the menu. Parent ID The ID of the parent menu. Title Text/HTML shown in the Toolbar. href The 'href' attribute for the link. If none set the menu will be a text menu. Menu Group Choose... Yes No Group menu items together into distinct sections using add_group() method. HTML The HTML used for the menu. Class Attribute The class attribute for the list item containing the link or text. Target Attribute The target attribute for the link. Will be set if 'href' is present. onClick Attribute The onclick attribute for the link. Will be set if 'href' is present. Title Attribute The title attribute. Will be set to the link or a div containing a text node. Tabindex Attribute The tabindex attribute. Will be set to the link or a div containing a text node. Toolbar 2 ID The ID of the menu. Parent ID The ID of the parent menu. Title Text/HTML shown in the Toolbar. href The 'href' attribute for the link. If none set the menu will be a text menu. Menu Group Choose... Yes No Group menu items together into distinct sections using add_group() method. HTML The HTML used for the menu. Class Attribute The class attribute for the list item containing the link or text. Target Attribute The target attribute for the link. Will be set if 'href' is present. onClick Attribute The onclick attribute for the link. Will be set if 'href' is present. Title Attribute The title attribute. Will be set to the link or a div containing a text node. Tabindex Attribute The tabindex attribute. Will be set to the link or a div containing a text node. Toolbar 3 ID The ID of the menu. Parent ID The ID of the parent menu. Title Text/HTML shown in the Toolbar. href The 'href' attribute for the link. If none set the menu will be a text menu. Menu Group Choose... Yes No Group menu items together into distinct sections using add_group() method. HTML The HTML used for the menu. Class Attribute The class attribute for the list item containing the link or text. Target Attribute The target attribute for the link. Will be set if 'href' is present. onClick Attribute The onclick attribute for the link. Will be set if 'href' is present. Title Attribute The title attribute. Will be set to the link or a div containing a text node. Tabindex Attribute The tabindex attribute. Will be set to the link or a div containing a text node. Toolbar 4 ID The ID of the menu. Parent ID The ID of the parent menu. Title Text/HTML shown in the Toolbar. href The 'href' attribute for the link. If none set the menu will be a text menu. Menu Group Choose... Yes No Group menu items together into distinct sections using add_group() method. HTML The HTML used for the menu. Class Attribute The class attribute for the list item containing the link or text. Target Attribute The target attribute for the link. Will be set if 'href' is present. onClick Attribute The onclick attribute for the link. Will be set if 'href' is present. Title Attribute The title attribute. Will be set to the link or a div containing a text node. Tabindex Attribute The tabindex attribute. Will be set to the link or a div containing a text node. Toolbar 5 ID The ID of the menu. Parent ID The ID of the parent menu. Title Text/HTML shown in the Toolbar. href The 'href' attribute for the link. If none set the menu will be a text menu. Menu Group Choose... Yes No Group menu items together into distinct sections using add_group() method. HTML The HTML used for the menu. Class Attribute The class attribute for the list item containing the link or text. Target Attribute The target attribute for the link. Will be set if 'href' is present. onClick Attribute The onclick attribute for the link. Will be set if 'href' is present. Title Attribute The title attribute. Will be set to the link or a div containing a text node. Tabindex Attribute The tabindex attribute. Will be set to the link or a div containing a text node. Update Code Save Snippet
// Add Toolbar Menus function custom_toolbar() { global $wp_admin_bar; } add_action( 'wp_before_admin_bar_render', 'custom_toolbar', 999 );