0

How to Add a Submenu to the WordPress Admin Bar

A while back I composed Add Menu Items to the WordPress Admin Menu, a post enumerating how you can add things to one side, existing “posts” menu bar. Including menu things has served me well yet it’s not as redone as I might want – regardless i’m adjusting to WordPress rather than WordPress adjusting to me. By making a custom top bar menu, I can blend and match connects all I need!

$wp_admin_bar, add link to admin bar wordpress, add_node wordpress, admin_bar_menu action, how to add menu in wordpress admin dashboard, wordpress admin_bar_menu, wp_before_admin_bar_render, wp-admin-bar-top-secondary

Like adding functionality to your theme and other admin area, the directives will go in your theme’s functions.php file. The code itself should be self explanatory:

Setting an id on the parent menu item allows you to use the parent key for submenu items; the rest of the keys are easy to figure out.  With the menu created, you simply need to add the WordPress hook and specificity to add it!

Leave a Reply

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