Re: Adding menu items to the admin bar
@Jens Wedin @alanchrishughes
I was looking for a way to include all navigation links in one navbar. Jens’ code snippet is brilliantly simple. Thanks!
The only drawback is you have to add links manually to get them to appear in the adminbar.
I’ve modified the code (borrowing inspiration from a snippet previously written by @David Lewis) so that:
1 – all “standard” BP Directory links appear automatically in their own dropdown;
2 – all BP plugin directories (Links, Gallery, etc) are automatically added to that dropdown;
3 – all WP pages are added automatically to the adminbar;
4 – all added WP pages respect whatever page order is set in the WP-Dashboard.
The code is here: http://pastebin.com/8FJmcgRF
To ensure that unwanted pages DON’T show up in the adminbar navigation (password-protected, Thank You pages, etc), install the Exclude Pages plugin:
https://wordpress.org/extend/plugins/exclude-pages/