Note of Plugin Discontinuation:
WordPress 3.1 features a built-in admin bar like this, so I will no longer continue development of this plugin. I recommend uninstalling this plugin as it will no longer be maintained.
Description:
This plugin creates an admin bar at the top of your site for logged in users (i.e. you) based on the design of the admin bar located at WordPress.com. It has links to all popular areas of the admin area, saving you time.
It requires no theme editing whatsoever — just upload and activate and you’re done.
Download:
Adding Custom Themes:
If you’re the author of a WordPress theme or just otherwise wish to add an custom admin bar theme of your own, please check out this plugin’s theme API.
Screenshots:
Frequently Asked Questions
Q: Some plugins don’t show up in the admin bar. What gives?
A: The author of the problematic plugin has a is_admin()
test when creating their admin menu which means that if you’re outside of the admin area, their plugin won’t register it’s admin menu. Therefore it of course won’t show up in my admin bar. Contact them and ask them to remove the is_admin()
test (or do it yourself).
zonebattler on February 6th, 2009 at 2:04 AM wrote:
It’s a CSS issue. I thought I fixed it, but apparently not. Doing the same thing on my blog.
zonebattler on February 6th, 2009 at 2:04 AM wrote:
It’s Opera’s fault. Looks fine here in Firefox and I’m not sure what’s causing it. :/
Viper007Bond on February 6th, 2009 at 2:58 AM wrote:
It’s a CSS issue. I thought I fixed it, but apparently not. Doing the same thing on my blog.
zonebattler on February 6th, 2009 at 2:04 AM wrote:
It’s Opera’s fault. Looks fine here in Firefox and I’m not sure what’s causing it. :/[/quote]
Thanks a lot for the quick response! Well, if you can live with the CSS issue, so will I!
And about the arrow icon being cut in half by Opera: it seems to be a spacing and/or padding issue. Are there any tables involved with fixed cell width? Opera is renowned to be quite precise (if not stubborn) in interpreting HTML code whereas other browser seem to behave more tolerant to inplausible parameters… 😉
Addendum: The “cut triangle icon case” seems to be an issue of the plugin’s own color schemes: The problem does *not* show up when I switch to the “WordPress Classic” theme with its more generous spacing between the dropdown menues…
zonebattler on February 6th, 2009 at 3:51 AM wrote:
No, it was fixed in v3.1.3. 😉
zonebattler on February 6th, 2009 at 3:51 AM wrote:
No, the entire admin bar is an unordered list with inline list items.
Addendum 2: Fixing the CSS issue of not indented sub-items
Adding the lines:
.wpabar_toplevel ul li {
padding-left :25px;
}
in the wp-admin.css does the trick! (courtesy of Lexikaliker)
zonebattler on February 8th, 2009 at 8:31 AM wrote:
Was my fix in v3.1.3 not sufficient?
Actually, it wasn’t. But never mind, the solution I found works fine! Thank you nevertheless for your quick support.
Viper! I just tried this for the first time and it’s blowing my mind. I’ve minimized the sidbear in the admin and might never need it again, your plugin is better!
That said, I have a huge site with hundreds of users and I need to be able to control the defaults to hide the mostly useless items like ‘tools’. Looking at your code I can see that you built in the concepts of $this->defaults[‘hide’] for this purpose but never got around to building an admin UI to populate the list. Luckily I hate the idea of building a UI as much as you. If someone has enough users to need this feature they should know how to call a hook!
So I think you should just add a filter on the $this->defaults array like you do so people can add themes. Here’s the code to add the filter, just like for themes:
And here’s an example of how simple it would be to use the filter for controlling defaults:
IMHO this is the best way forward for your plugin. Keeps it light while also making the functionality fairly simple for those who really need it.
It’s a lot to ask but if you dont’ want to include this could you possibly drop me an email so I can figure something else out? I’m sure I can control the defaults in a hackier way by hooking into get/save options but if I can depend on this going into the next version of the plugin it would save me and eveyrone else a lot of time 🙂
zonebattler on February 8th, 2009 at 11:48 PM wrote:
Works fine for me. Opera must be being horrible once again. 😉 I’ll fiddle with how I do the indenting in the next version.
Jeremy Clarke on February 9th, 2009 at 10:25 AM wrote:
I was thinking I did have a filter. I’ll double check and add one if not. 🙂
Hello,
first of all – thanks for this work.
My suggestion is to make the admin bar only availabe for admins. I think the best ist to configure this with a CheckBox.
Thanks and regards
Gernot
Germany
Gernot Riebold on March 15th, 2009 at 2:27 PM wrote:
A valid suggestion, but for now it’s an easy edit. On line 49 of the plugin:
if ( !current_user_can('read') ) return;
Change it to:
if ( !current_user_can('manage_options') ) return;
I think its a pretty useful idea, though rather than making it a checkbox for ‘show only to admin’ it would be cool if it was a pulldown with several different capabilities and you keyed it on that. Like
“only show admin bar to users who can [read | edit_posts | publish_posts | manage_options]”
That way people could hide it from just subscribers but not authors (and obviously it should be keyed to a capability like manage_options rather than a role, because roles are always optional/user defined)
I bet you could also use the $this->defaults filter to just remove all pages from any user that isn’t an admin, but that’s not really a full solution (cause they could add it themselves after).
Yeah, if/when I implement it, it’d be that way. No sense in limited it to just one capability. 🙂
Thank you for submitting WPMU enhancement to trac http://trac.mu.wordpress.org/ticket/883 I was dismayed when your admin bar which worked very well across all blogs for all users in previous WPMU got limited to site admin only when it was incorporated in WPMU core in 2.7
Peace.
mercime on March 19th, 2009 at 3:09 AM wrote:
My plugin and the version you find in WPMU have gone their seperate ways. My plugin only shows up on WPMU blogs which you have access to. Donncha however is working on making it work more like WordPress.com.
I love your plugin sh@#. AWESOME STUFF. WP Admin Bar concern. I use a plugin named WP125 that manages 125×125 ads. The navigation works fine in the side nav on WP admin pages. It also shows up and works fine in your plugin except for the “Manage” link. Some how it gets fouled up. WP125 uses a strange link to get to the “Manage” portion of it’s plugin: /wp-admin?page=wp125/wp125.php (the ‘/’ may be causing the issue). Not a huge concern as I have another link to get to the ‘Manage’ page via the admin but wanted to run it by you to see if there was a quick fix. The other links use a more traditional link: /wp-admin?page=wp125_settings. This causes no issue with your Admin Bar.
Again love your work. You are a ‘WordPress Star’ in my book.
My plugin works fine with plugins that use
script.php?page=plugin/plugin.php
. I use a plugin or two that does that with no issues.If a plugin isn’t working with my plugin, then it’s a very good chance that the other plugin is at fault.
Pingback: THE Wordpress Shortcut Tip of the Decade - It’s Almost Hidden | uber.la
Great news. I am sure it is the other authors issue. Do you know of an example plugin that uses the: /wp-admin?page=wp125/wp125.php structure? (besides WP125 of course). I would like to use it as a model to fix WP125. Then I could pass the code on to the WP125 author. I checked all my plugins and none of them call the /wp-admin?page= with a slash in the value. Any help would be appreciated.
Again love your plugins.
Kerry Webster on March 26th, 2009 at 5:30 PM wrote:
Just switch from using the old method (filename) to the preferred method (stub). Replace “__FILE__” with “somestub”.
add_options_page('Page Title', 'Menu Title', 'capability', 'stubhere', 'function_name');
I want to control what other users see. As an example, I don’t want any users except the admin to see comments or tools. Is there a way to control that?
TwisterMc on March 31st, 2009 at 6:10 PM wrote:
It goes off normal permissions. Only users who can see the “Tools” menu in the admin area can see it in the admin bar, i.e. admins only.
Viper007Bond on March 31st, 2009 at 10:10 PM wrote:
I’ve found that the tools menu especially can be really annoying, because if even one of your plugins has an author-accessible menu item under tools (including anything previously under Manage that hasn’t been recoded) all users end up seeing the tools menu. The ‘options’ menu also shows up with only one option ‘admin bar’…
This is the main reason I asked for that patch to allow filtering of the $defaults array, so I could hide the boring ones by default so that the menu isn’t overloaded with stuff (my site is thinner than the default admin bar, meaning the extra menu items bust down into my layout).
TwisterMc: Check out my earlier comment about filtering the defaults if you want to hide certain sections by default. Your users will still be able to edit their options to show the menu but they will be off by default. Another avenue to investigate would be installing the Role Manager plugin and trying to limit visibility that way. Just create a dummy author account and log in as it to see how things work.
Viper007: Any chance that the admin bar options could be moved into the users/profile menu instead of options? Where it is now seems to me to indicate that it is a global option that would affect all users, rather than a personal setting (like visual editor, which is under profile). It would mean that pretty much all non-admins would have one less menu item all the time.
jeremyclarke on April 1st, 2009 at 7:51 AM wrote:
I can’t control other plugins and where they put their menus. 😉
jeremyclarke on April 1st, 2009 at 7:51 AM wrote:
Yes, I need to do this. However you can also just use the
wpabar_menuitems
filter to completely remove menu rather than just making it hidden by default.TwisterMc: Check out my earlier comment about filtering the defaults if you want to hide certain sections by default. Your users will still be able to edit their options to show the menu but they will be off by default. Another avenue to investigate would be installing the Role Manager plugin and trying to limit visibility that way. Just create a dummy author account and log in as it to see how things work.
jeremyclarke on April 1st, 2009 at 7:51 AM wrote:
That is a very good idea.
The new 2.7.2 + Nextgen have a problem in the admin bar…
If you go to Gallery–> Overview — Dosent work…
But if you go to the “normal” admin control the “Overview” works.
This is a minor thing but maybee you could fix it in the new release
Thanks for a wounderfull Plugin.!!!!
I can confirm the bug reported by Casperse. I have exactly the same issue with my SermonBrowser plugin. It seems that plugins that create their own menu page (not just a submenu) cause the bug, which gives the wrong URL for the first submenu item.
Important suggestion!
You should enable for admin to customize what other user types have in the bar.
Just like all the settings in the screenshot (where it says “everything here applies to your account only.”) but instead should be editable for each user type.
What do you think? Thanks! -Joe
Hi,
this is a very nice plugin, but i have a question…
how can I add the menue into a widget or a other place of my website.
I want to get the plugin so that it shows on a other place like the place from the widgets.
I need a code, to include the plugin into other places…
thanks for the plugin and your help… sorry for my bad english… german 😉
have a nice day
hella
Is it possible to still show the list of blogs available to the user from a drop down menu? The new “My Blogs” page is now showing up in the dropdown ever since upgrading to WordPress MU 2.7.1. I would like to show all of the available blogs for that user instead.
Thanks!
@Brian As mentioned above the version of admin bar present in WPMU isn’t mainted by Viper, it was ported into the actual MU codebase and thus is under the control of Donncha and the other core MU developpers.
WPMU Forums, WPMU Trac Bug Trcker.
@jeremyclarke My apologies. According to http://ocaoimh.ie/2009/04/21/wordpress-mu-271/ I had seen that with 2.7.1 it had once again been taken out of the core WPMU and once again referred to Viper. I guess I’ll wait for more updates over there. Thanks!
Well gee, don’t I look silly. Sorry about that, didn’t realize Donncha removed it, crazy that it only lasted 0.1 versions!
I haven’t ported over any of the changes made by the WPMU guys.
As for WPMU-specific features, I honestly don’t have the motivation, time, or WPMU experience to do it. I happily accept patches though! 🙂
Can I make a request to make the plugin compatible with the Gengo plugin? Gengo is a multilingual plugin that changes the WP language on demand. It obviously needs to hook in as early as possible, so hooks into plugins_loaded. Unfortunately it breaks if other plugins call load_plugin_textdomain before Gengo has loaded, and this plugin therefore breaks it. Could you move your call to load_plugin_textdomain to the init action? You obviously don’t need to output any text until after init. Thanks.
Mark Barnes on April 30th, 2009 at 6:23 AM wrote:
If it’s so important for Gengo to hook in as early as possible, then it really shouldn’t be using the default 10 priority, but meh, whatever.
v3.1.5 of my plugin has an increased priority (15).
Hi, I have recently found and this plugin and looks indeed great. Very useful.
However, while it works fine on a new blog I am working on, I’ve noticed that the HMTL/JavaScript used by Admin Bar is outputted twice in the HTML generated for a page. I have installed a number of other plugins, so I was wondering if this is something others have noticed with Admin Bar and whether or not this weird behaviour might depend on a conflict or something with other plugins?
Thanks
By the way, I am using Google Chrome on Vista x64 right now… not Safari on Mac OS 😀
On WPMU 2.7.1, I was getting a ‘max redirect exceed limit’ error when trying to move between backends using the Dashboard Menu dropdown. It may be something with the way that my sites are set up with Domain Mapping but changing
“admin_url( $url )” to just “( $url )” in line 422
did the trick. Now all URLs in the bar are relative with no looping. Works great!
BTW, I thought I was going batty when the Admin Bar disappeared one day and I thought I’d screwed up somewhere. Didn’t occur to me that the update from 2.7 to 2.7.1 may have done it. Glad I found this. Thanks.
great plugin.
would be great to add the option to hide the “old” menu and the “wphead” cause this is “duplicate content” …
thanks !
Vito Botta on May 6th, 2009 at 12:49 PM wrote:
Try the default theme. Your theme must have the hooks twice or something.
BJ Johnson on May 6th, 2009 at 8:20 PM wrote:
The version included in WPMU is a fork of my plugin. You’ll need to file bug reports on the WPMU Trac: http://trac.mu.wordpress.org/
andre on May 7th, 2009 at 1:29 AM wrote:
You can easily collapse the original WordPress menu. Just click the little arrows.
Viper007Bond on May 7th, 2009 at 2:00 AM wrote:
Try the default theme. Your theme must have the hooks twice or something.[/quote]
I am using Thesis Theme. Are there any known issues with this them?
Vito Botta on May 7th, 2009 at 4:20 AM wrote:
I have no idea. I can’t be expected to know every single theme. 😉
As I said, try the default theme.
Viper007Bond on May 7th, 2009 at 2:02 AM wrote:
I know. But I’m in 2.7.1 and am using your plugin to get it back. However, today I found that in restoring the site-wide plugin activation capability, that was removed by a theme editor plugin that had its own mu.php, and reverting back to the 2.7.1 mu.php, the individual blog backend choices in the Dashboard drop-down menu no longer appear. Additionally, clicking on “My Blogs” in that menu now returns:
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘blogs.php’ was given in /usr/www/users/[username]/wpmu/wp-includes/plugin.php on line 339
And it was working so well…
@Viper007: I’m afraid the change you made in 3.1.5 doesn’t fix the problem with Gengo. Multi-lingual filters are necessarily complicated. If you call load_plugin_textdomain on plugins_loaded (even at a later priority), it means that locale can’t be filtered, which is necessary when multilingual plugins are used. Following a discussion on Trac, Ryan Boren said “Plugins that load their textdomain before init is complete are broken”. Could you therefore move load_plugin_textdomain to init?
http://core.trac.wordpress.org/ticket/1175#comment:14
Just upgraded to MU 2.7.1 and installed this restore the admin bar but now I get and error when selecting ‘my blogs’:
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘blogs.php’ was given in /usr/www/users/[username]/wpmu/wp-includes/plugin.php on line 339
How can I fix this please?
I’ll have to disable for the moment but doing that defeats the object somewhat.
Many Thanks
Knolly on May 15th, 2009 at 5:39 PM wrote:
I believe there’s a bug in my code when it comes to WPMU. It was fixed in the WPMU fork, but I have yet to port over the change made by the WPMU developers.
Can you post what you did so I can fix myself please?
Not your fault but I had no idea 2.7.1 would screw up the admin bar so you plugin was a life saver. I’m in big trouble as most users on our blogs will be totally bemused wondering what’s happened to the navigation. They’ll click the ‘my blog’ link and get even more confused by the PHP error. If there’s a way to turn off ‘my blogs’ on the top admin bar globally for MU I’d appreciate knowing what that is, or failing that if I can have the code to fix it myself.
I can send an email to all contributors, but if there’s another way to make the transition seamless please let me know
many thanks
Knolly on May 16th, 2009 at 2:57 PM wrote:
I didn’t do anything. The WPMU developers fixed the WPMU-specific bug.
Try copying the version in
/wp-includes/wordpress-admin-bar/
tomu-plugins
and see if that works.