Adding menu items to the admin bar
Others have asked, but I haven’t found an easy solution to make dropdown menu items from my pages and post categories in the Buddypress admin bar? I want to use the bar as my main navigation menu.
I noticed though that $wpListPagesLabel appears twice in the globals, but $pageLinkDropdown isn’t there. So I switched it.
Got to get to work right now but, when I get back home, I’ll try to do the same for the BP pages “Community” dropdown label. Then run the code through its paces on my install.
This is lots of fun… thanks for playing!
BTW, nothing I’ve uploaded to subversion (I use TortoiseSVN) appears in trunk, and my (EDIT: our) plugin is nowhere to be found in the repo. I guess its a sign… not ready for release yet
Good spot, that’s why second eyes are vital, also the $hideMainNav doesn’t need to be globally scoped as the function sits outside pages() and the variable is already in the main page scope so no global required for it.
Not sure how the process works for uploading plugins but would guess it hasn’t been approved yet?
If I have a minute I’ll add the config variable for ‘Community’ link then you can run things through their paces when your back.
Added the ‘Community’ label conf variable and corrected the globals
@hnla Well now, great progress!
I remember writing at some point that it’s often the most obvious that escapes me… Turns out I hadn’t “actually” selected any files to upload to subversion… I was just going through the motions and clicking buttons (doh!). The first version of the plugin is up and I just updated it with a whole bunch of cool new stuff. Code here: http://pastebin.com/Qquwe9pH
Thanks to your examples, I created 3 new custom configuration options: in addition to hide/show the main nav, users can now choose to hide/show the site name/logo, the Login/Signup links, and the Visit Random dropdown. I’ve also completely revamped the readme with a detailed FAQ, and added a fully commented stylesheet with the rules I use for my site to help get folks started on customizing their new admin/navbar.
Thanks a whole bunch for your invaluable help and instruction on this project! I can now say I’ve popped my plugin cherry!
Now we just have to wait for subversion to update………
- The topic ‘Adding menu items to the admin bar’ is closed to new replies.