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).
[quote comment=”55546″]1. Yes, too many false positives. Out of curiosity, which anti-spam plugin are you using, then?[/quote]
Just Defensio.
[quote comment=”55546″]3. For your information, I am also using another admin menu plugin (“Lighter Admin Drop Menus”), and this one has “Bad Behavior” listed.[/quote]
That’s because that plugin is in your admin area. BB has code that makes it only register it’s options page when you’re in the admin area.
I would recommend a small update to the CSS:
body {padding-top: 29px !important;
background-position: 0px 29px;
}
This will take care of the background position as well.
[quote comment=”56283″]I would recommend a small update to the CSS:[/quote]
The problem with that is some themes, like the one in use on this site, use a fixed background image. If I bump down the background image, it will stay bumped down even if I scroll the page.
So I decided to leave that out as the majority of users who will see the admin bar will be owners of the site not random users who would care.
Hi,
I noticed that for some plugins like StatPress which have additional parameters in their menu item URLs, the admin bar will create invalid (X)HTML. This is not relevant for visitors of course, but it gave me 10 validation errors which make looking for those errors that are visible to visitors a bit harder. You can fix it by simply replacing
$this->adminurl . $urlwithhtmlspecialchars($this->adminurl . $url)in line 133 of the php file.Cheers,
Robert
Hi Viper,
I am a big fan of the plugin. I have detected two issues with it, but I cannot decide if it is a theme conflict or something else. They definitely go away if I am not logged in.
First, if one tries to go to an individual comment at the end of a long thread, the page will not drop you to the correct comment, rather at some comment further up in the thread. I suspect that this thread would have enough comments to display the issue if you tried to get to the end of the thread.
Second, if I have a flash video embedded in a post, as I scroll down the video appears to go invisible at a fixed point on the screen. The result is that as I scroll down, the video appears to drop behind a hidden horizontal line.
Neither of these seems to affect a regular user, just a user logged in while the admin bar is present.
Any suggestions would be appreciated.
[quote comment=”64603″]First, if one tries to go to an individual comment at the end of a long thread, the page will not drop you to the correct comment, rather at some comment further up in the thread.[/quote]
No problems here with that. Occasionally it’ll be higher on the page, but that’s just Firefox screwing up (like scrolling, then some content loading or whatever).
[quote comment=”64603″]Second, if I have a flash video embedded in a post, as I scroll down the video appears to go invisible at a fixed point on the screen. The result is that as I scroll down, the video appears to drop behind a hidden horizontal line.[/quote]
Are you running the latest version? I fixed that a while ago. If it’s still happening, then you need to set “wmode” to “transparent” on the Flash video.
Is there any hope that this will be ported to WordPress MU? Not as a user enabled plguin, but as a global plugin?
[quote comment=”72273″]Is there any hope that this will be ported to WordPress MU? Not as a user enabled plguin, but as a global plugin?[/quote]
It works just fine on WPMU. I personally have it installed on a client’s site.
Just dump it directly into the
mu-pluginsfolder (keep the subfolder intact though) and then change the$foldervariable at the top of the plugin.I’ll probably eventually make it automatic, but for now, that’ll do.
Hmm, i enabled it on my site, yet i get no bar, even though i am logged in
[quote comment=”73531″]Hmm, i enabled it on my site, yet i get no bar, even though i am logged in[/quote]
Your theme is probably lacking the needed hooks.
http://wordpress.org/extend/plugins/wordpress-admin-bar/faq/
It needs wp_head() in the header and wp_footer() in the footer.
Its based off of K2, but heavily modified, and it has both tags. wp_head() is in the head section of the html, if that makes a difference.
[quote comment=”73574″]Its based off of K2, but heavily modified, and it has both tags. wp_head() is in the head section of the html, if that makes a difference.[/quote]
Then it should work fine. Check the HTML source and look for my plugin’s CSS in the header and the plugin’s HTML in the footer.
I looked in both areas of the generated source, and saw nothing. The $folder is set to /wp-content/mu-plugins/wordpress-admin-bar, and that is the installation location
[quote comment=”75229″]I looked in both areas of the generated source, and saw nothing. The $folder is set to /wp-content/mu-plugins/wordpress-admin-bar, and that is the installation location[/quote]
WPMU won’t load up plugins located in subfolders. Move all the files from “wordpress-admin-bar” to “mu-plugins” and then set $folder to “/wp-content/mu-plugins”.
That did the trick.
Hi
Great plugin. To work as I wanted it in both Site and Admin view I had to make the following modifications to control screen content with some JS. Let me know if this functionality was build in and I missed it?
—— Code ——-
// Format the comments in moderation count in WP 2.5+ a little better
function ModeratedComments( $menu ) {
if ( stristr( $menu[20][0], ‘count-0′ ) ) return $menu;
$menu[20][0] = str_replace(
array( “<span id=’awaiting-mod’ class=’count-“, ” ),
array( “(<span id=’awaiting-mod’ title='” . __(‘Moderated comments count’) . “‘ class=’count-“, ‘)’),
$menu[20][0]
);
return $menu;
}
}
// Added by Chris Pike to hide elements of the screen contents (Part 1 of 2) – 6th May 2008
function wp_adminmenu_js($menu = ”) {
echo <<<JS
JS;
}
// end of Chris Pike Addition (Part 1 of 2)
// Start this plugin once all other files and plugins are fully loaded
add_action( ‘plugins_loaded’, create_function( ”, ‘global $WPAdminBar; $WPAdminBar = new WPAdminBar();’ ) );
// Added by Chris Pike to hide elements of the screen contents if you are Admin (Part 2 of 2) – 6th May 2008
if (is_admin()) {
add_action(‘init’, create_function(”, ‘wp_enqueue_script(“jquery”);’));
// end of Chris Pike Addition (Part 2 of 2)
}
[quote comment=”85402″]Let me know if this functionality was build in and I missed it?[/quote]
Yeah, it is. You coulda saved yourself a lotta trouble. Lines 34 and 35 are two commented out hooks that’ll make the admin bar show up in your admin area. 😉
It doesn’t hide the new menus that were added in 2.5, but some more CSS will handle that.
My added code purely deals with the built in content of user_info, dashboard, admin.
In my first post I failed to post correctly and some code was lost, I do use your code at lines 34 and 35. Here goes again, I hope:
// Added by Chris Pike to hide elements of the screen contents (Part 1 of 2) - 6th May 2008
function wp_adminmenu_js($menu = '') {
echo <<<JS
JS;
}
// end of Chris Pike Addition (Part 1 of 2)
// Start this plugin once all other files and plugins are fully loaded
add_action( 'plugins_loaded', create_function( '', 'global $WPAdminBar; $WPAdminBar = new WPAdminBar();' ) );
// Added by Chris Pike to hide elements of the screen contents if you are Admin (Part 2 of 2) - 6th May 2008
if (is_admin()) {
add_action('init', create_function('', 'wp_enqueue_script("jquery");'));
// end of Chris Pike Addition (Part 2 of 2)
}
Let’s not use the comments area for complex, multi-response conversations. I have forums for that. 😉
http://www.viper007bond.com/wordpress-plugins/forums/viewforum.php?id=25
Pingback: Das ultimative Adminmenü: WordPress Admin Bar 3.0 | BlogPimp
This new version is over the top. Thank you for taking the time to bring this to the community!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[quote comment=”129289″]This new version is over the top. Thank you for taking the time to bring this to the community!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!![/quote]
Glad you like it! 🙂
Pingback: Upgrading WP: Taking The Plunge : Learn How To Do Things
You know I like this plug-in a lot, my only thing about the the including of themes is this; I would like to see an easy to add new themes…
Here are two of my modified themes on my blogs here (v2.0.5) and here (v3.0.0)
P.S. I would also like the option to remove the log off from the bar.
Awesome this new version is just awesome, I love the gray theme!
Some plugin options don’t appear in the menu generated by your plugin. E-mail me privately if you want the details; I could send you info.
[quote comment=”129678″]Awesome this new version is just awesome, I love the gray theme![/quote]
Thank WordPress.com for that one. I stole it off them as I did the classic blue one before, hehe. 😛
[quote comment=”129816″]Some plugin options don’t appear in the menu generated by your plugin. E-mail me privately if you want the details; I could send you info.[/quote]
Don’t bother, I can tell you the problem right now — it’s the other plugins’ faults. They most likely are not registering their menus at all times, rather only in the admin area. For example, they are probably doing
if ( is_admin() ) { ...before they register their menu(s).There’s nothing I can do to work around it as it’s their plugin that needs to register the menu. Contact the authors of the plugins and tell them to have their plugins always register their menus regardless of whether it’s in the admin area or not and that should fix the problem. 🙂
Whoops, accidentally deleted someone’s comment about themes (clicked “Delete” instead of “Approve”). If that was your comment, please post it again. Sorry.
That would be my comment you deleted heh XD I don’t rember exactly what I said but here is what I can remember:
Anyway I would like to know if there is an easier to add new Admin bar themes. The way I did it was to edit the php file and add a new folder (/wordpress-admin-bar/themes/custom1)and copy then modify the css file from another admin-bar theme.
Also I noticed while debugging that if I log in as a subscriber (maybe other user levels) that it gives my the option to change admin-bar settings in the admin-bar but if I click on it it tells me “You do not have sufficient permissions to access this page.”
I realized after I posted my comment and did not see it show up that because I posted two URLs my comment would get get sent for moderation. I hope I explained this well if not email me at trm96@trm96.com
[quote comment=”130210″]Anyway I would like to know if there is an easier to add new Admin bar themes.[/quote]
lol, there’s much easier ways. I made sure to include an API and a filter. No need to edit anything inside this plugin’s folder.
For theme developers, you just call a function (details here), but that’s if your CSS file and images are inside your current theme folder (i.e. if you want to distribute a WP Admin Bar theme with your WP theme).
Otherwise (i.e. adding a theme via another plugin) you’ll need to modify the themes array via the “
wpabar_themes” filter. An example plugin can be found right here.As for the not being able to edit the options for subscribers, I just tested and I didn’t have any problems.
is there a way the admin bar stays the same for all the nonadmins?
Hi Viper,
For your information, the other plugin I use “Lighter Menus) does list all my plugins.
Thanks or your attention,
Chris Masse
—
—
[quote comment=”129816”]Some plugin options don’t appear in the menu generated by your plugin. E-mail me privately if you want the details; I could send you info.[/quote]
Don’t bother, I can tell you the problem right now — it’s the other plugins’ faults. They most likely are not registering their menus at all times, rather only in the admin area. For example, they are probably doing
if ( is_admin() ) { ...before they register their menu(s).There’s nothing I can do to work around it as it’s their plugin that needs to register the menu. Contact the authors of the plugins and tell them to have their plugins always register their menus regardless of whether it’s in the admin area or not and that should fix the problem. :)[/quote]
I love the new admin bar. Though I have one concern.
It would be nice to have the admin bar appear to all the users as the way set up by the administrator instead of users(non admins)going in and change. I am not a php person so any help would be appreciated. Thanks
[quote comment=”131129″]I am not a php person so any help would be appreciated. Thanks[/quote]
It’s not an simple change.
I’ll consider adding such a feature into the plugin myself.
This new theme is really great. Congretulations on the 3.0!
Pingback: netztreiben.de » Blog Archive » Wordpress 2.5 - Adminbereich effektiv einrichten
You have to add a float layout to the div’s in the wordpress-admin-bar.php file.
style="float: left;"andstyle="float: right;"this is a ie-hack, otherwise it won’t ‘work’ (covers the other menu) with version 3.0.0 in IE7 😉
[quote comment=”136506″]You have to add a float layout to the div’s in the wordpress-admin-bar.php file.
style="float: left;"andstyle="float: right;"this is a ie-hack, otherwise it won’t ‘work’ (covers the other menu) with version 3.0.0 in IE7 ;)[/quote]
What theme? Grey?
Pingback: elektroelch » Blog Archive WordPress Crazyhorse … no thanks! »
Thanks for the response…When do you think you can make the change to make the admin bar same for nonusers?
[quote comment=”147169″]Thanks for the response…When do you think you can make the change to make the admin bar same for nonusers?[/quote]
Non-admins or non-users?
Non-admins: I dunno, I’m pretty busy lately.
Non-users: Umm, never. Why would you want an bar with links to the admin area for users who aren’t logged in?
Yes …Only for Non admins…Thanks for the reply..I am going to go back to the old version..and will upgrade it once this change is made..Liked the new version a lot especially hiding some menus.
Hi,
I think I found a bug: I installed Admin bar in my WordPress MU and two of my mu-plugins (MU tags and signup question) got listed in submenus.
Thanks for your time!
Nevermind. It is not a bug in Admin bar. There are a small bugs in those plugins. Thanks for your great plugin.
[quote comment=”149684″]Yes …Only for Non admins…Thanks for the reply..I am going to go back to the old version..and will upgrade it once this change is made..Liked the new version a lot especially hiding some menus.[/quote]
Just like the old version, the new version displays for ALL logged in users.
Nice plugin man. I just lack one thing: a link to the website. I’m often not able to move quickly from administration to the outer-site. Yes, it’s because I hid the area where the link usually is. But anyway, it would be nice to have such a link in the bar. What do you think?
[quote comment=”150968″]Nice plugin man. I just lack one thing: a link to the website. I’m often not able to move quickly from administration to the outer-site. Yes, it’s because I hid the area where the link usually is. But anyway, it would be nice to have such a link in the bar. What do you think?[/quote]
Eh, I don’t see the point since my plugin doesn’t hide the “View Site” link.
For your case though, you can easily add your own link. Just write a tiny plugin that uses the
wpabar_menuitemsfilter to modify the array and add your own link.Pingback: Querblog.de - Plugin oder lieber einfach?
Small problem with Admin Bar 3.01 and WordPress 2.51 (Default Theme & no other plugins)
If I enable the Admin Bar under administration the Gallery is missing se picture here:
http://img77.imageshack.us/img77/8162/errorgp7.jpg
So I hope you can fix this issue really love your plugin!!!
If fore some strange reason I am the only one with this problem?? (Cant see how)
I appolligies…(-;
Pingback: Admin Bar Space Saving Extension | Kahi’s WordPress Notes