Helps gain control of the new Admin Bar. This gives you options to change who sees the Admin Bar based on their user role, change or override the default styling and remove the Admin Bar altogether.
Options Include:
- Disable Admin Bar Completely
- Disable Admin Bar on a User Role Basis (supports custom roles)
- Disable the "Content Bump"
- Customize CSS
- Session based disabling for entire site or by page
- Hides the Profile display options when the Admin Bar is hidden for your user level

I use your plugin and it works great, but I have exedently pressed the Hide Site Wide button. How can I get the Admin bar back?
The “hide site wide” button is a temporary hide that will revert back once you close your browser window or clear your cookies.
Thanks, I use a plugin for my browser that keeps sessions and cookies alive. I have reset this plugin and the bar is back. Thanks!
Hi there I stumbled on your website by mistake when i searched Yahoo for this concern, I must tell you your page is absolutely helpful I also enjoy the style, its amazing!
I get
Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/mikesuss/public_html/alphasigs.net/wp-content/plugins/wp-custom-admin-bar/custom-admin-bar-functions.php on line 89
in place of the Admin Bar for user roles that shouldn’t see the bar. I love what this plug in should do – thanks – but wanted to let you know about this bug (or something). I posted on the WordPress Plugin forums.
Looks like a great plugin… it does not seam to work on my MS installation…, I only see the admin bar when everybody is enabled…
http://img402.imageshack.us/img402/2424/ss20110305010259.png
The moment I disable even just the subscribers, it stops working…
http://img402.imageshack.us/img402/677/ss20110305010234.png
Any pointer on how what could be the issue?
Looks like great coding job and info pointers for WP anyways, look forward on following your progress…
Cheers.
Hi Wes,
Thanks for the plugin! This is very useful for leveraging greater control over the admin bar.
I use your plugin in tandem with the Debug Bar so that only certain user levels have access to the debug bar when I’m developing a site. This means that I have
WP_Debugon almost all the time. This has caused a couple of errors to surface, so I thought I’d pass the fixes along to you:On line 14 of
custom-admin-bar-functions.php, it’s more helpful to hook into'wp'than'parse_query'. This is because, when parse_query runs, the current queried object has not yet been created. I’d also suggest startingcab_hide_by_page()with something likeif( did_action( 'wp' ){ return }so that it only runs once per page load. Without that, it will run every time you create a custom query object, whether or not it’s the main object that WordPress uses.Also, I changed line 97 from
$disabled_pages = $_SESSION['cab_disabled_pages'];to
$disabled_pages = isset($_SESSION['cab_disabled_pages']) ? $_SESSION['cab_disabled_pages'] : null;This prevents multiple errors that show up if no session data has been set for the user.
Thanks again!
John,
Thanks for the great suggestions. I wrote them in tonight along with some other small changes I had wanted to make. Look for an upgrade before the morning.
I had initially hooked into the ‘wp’ action, but couldn’t get the code to work. I moved the action hook back to ‘parse_query’ and it worked, so I left it. Now that I included
if( did_action( 'wp' ) > 1 ) return false;it works just fine at ‘wp’. Thanks for the help and if you find any more let me know!A very clever idea but I ran into a problem at nynsa.org.
Role exclusion doesn’t seem to work, and… the Role options don’t include all roles.
This might be the key to my issue, in that we have a custom designed Role, which doesn’t show up in the options.
Even Subscriber members, with Subscriber unchecked, still sees the admin bar.
This plunging is not currently designed to handle custom roles. I will add this to the list for future versions. Sorry that I couldn’t be more help at this time.
Hi,
this plugin is exactly what I am looking for, but unfortunatelly I can’t get it to work so far. I am using a buddypress MU site with the suffusion theme and want to to give my looged in users access to the dashbord of the motherpage. I konw that suffusen is triky with other plugins, but I definately need yours.
When I deactivate the admin bar altogeather the plugin does not show an effect and the admin bar is still there. When I choose different setting for different users I get the following error when visiting the site:
Fatal error: Call to undefined function get_queried_object() in /mnt/web9/53/45/5321645/htdocs/Visionautik/Teilnehmer/wp-content/plugins/wp-custom-admin-bar/custom-admin-bar-functions.php on line 94
Do you have any Idea what to do about this? I am thankfull for any help or hint!
All the best
Boris
The line causing your error uses a function that is only available since WP 3.1. This plugin requires that version or above. WordPress MU is no longer developed as a separate project and since WP 3.0 has been integrated into the normal installation.
So, I can only assume that you are using a version of WP older than 3.0. If you can upgrade to a new version of WP then this plugin will work, no promises for all of your other stuff (themes and plugins). But good luck.
Thank you so much for your promt reply.
Yes, I was using an old version and now I updated everything. The good news: I don’t get the error anymore. The bad news: The plugin still has no effect. I tried it with the buddypress default theme – no change. I deactivated all other plugins – still no change.
Any idea how I can get this to work?
Thanks for any hint.
Boris
From what I can remember about BuddyPress, having only installed it once, is that the Admin Bar that it uses is not the same implementation as the Admin Bar in WP 3.1. I am not sure that my plugin will or should have any effect on your Admin Bar. Unfortunately, I don’t see any way to support something that has become a minority situation in the WordPress landscape. Sorry and good luck!
Wes, the latest version is causing an error to occur on my site when I upgraded the plugin today:
Fatal error: Call to a member function get_names() on a non-object in /wp-content/plugins/wp-custom-admin-bar/custom-admin-bar-functions.php on line 31
I upgraded to 1.3 and am running it on a site using WP 3.1.1
Thanks!
Thanks so much for posting so quickly. There is a patched version that I just added to fix this issue. Please let me know if everything works.
Worked great Wes… thanks for the quick fix!
The only thing that would make this better would be a built-in admin bar editor and the ability to display things conditionally depending on user level :P
Please elaborate. What do you want to edit? The items in the admin bar? Is this also what you want to show/hid based on user level?
Hi,
I’m getting this when using wordpress 3.2.1:
Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at /home/avibuch/glosi.info/wp-content/plugins/wordpress-faq-manager/inc/faq-admin.php:147) in /home/avibuch/glosi.info/wp-content/plugins/wp-custom-admin-bar/custom-admin-bar-functions.php on line 8
Any help?
Thanks,
Avi
Where is the facebook like link ?
http://wesleytodd.com/custom-plugins/admin-bar-control/#fb-root
i love your custom admin bar but recently it is only working intermittently on my home page… is there any way for a non-techie to lock it into place?
Unfortunately, unless you can enable debug mode and see if there is an error, I will probably be unable to help you. If you, as a “non-techie”…lol….can edit the wp-config.php and enable this, then please feel free to post any error messages and I will do my best.
Hi Wes
Sweet plugin! I have been using it for the last month. Works really nicely with the s2members plugin as well.
However when I upgraded to wp3.3 (as admin) a new button appeared on the admin bar, called “admin bar” with a dropdown saying “Hide Site Wide”. Out of curiousity, I clicked on this, and my admin bar disappear completely. I cannot enable it again even though the appropriate checkboxes are all checked. I tried reinstalling the plugin but this didn’t work.
Regards,
Sher
Thanks for the good words. I am surprised that the menu item was not there before, because it should have been. But regardless, those buttons will only affect the currently open browser session. If you close the browser or clear your cookies your admin bar will come back.
Hello and congratulations for this useful plugin :-)
I’ve translated it in french today, feel free to download this translation here : http://www.wptrads.fr/extension/wp-custom-admin-bar/
Best Regards ;-)
The plugin works great but now I’m running into the issue of your plugin’s “Admin Bar” option being listed on the actual admin bar itself!
Not sure why that would even be remotely desired : /
Did I do something wrong?
The menu that is in the admin bar gives you the option to temporarily disable the admin bar for a single browser session. I personally use this when I am developing a site or new page and want to view it as a visitor would.
Hi,
I attempted to use your WP Custom Admin Bar plugin and my Admin Bar just vanished. Yes I checked the settings to make sure it was set to visible.
I’m working on a fresh WordPress 3.3.1 install and Version 1.3.2 of your plugin.
Compatible? If so, can you give me a hand. Could send you login info if you would like. Any help would be greatly appreciated.
There are a few problems with the default styling because WordPress changed the classes and ID’s, but there is no reason that I know of to make it disappear completely. Is it possible that you never saved the settings to be sure that is is set to enabled?
It’s really a hbroirle use of the admin bar by plugins if they’re just adding stuff just because they can. I have a single plugin that adds a new item to the admin bar. It goes under the Add New menu item for adding a new role (Members plugin). It would make no sense for that item to be under a more menu item.The better option is educating plugin authors about when it’s appropriate to add items to the admin bar. For example, there’s really no reason for plugin authors to add links to their settings page to the admin bar.Context is more important for items in the admin bar. By adding a more item, we’re inviting plugin authors to add even more crap.
Henk,
I pressed the Hide Admin Bar button to see what it did. I cannot get the Admin Bar back. I’ve tried clearing my cookies and cache, loging out, closing the browser. I used to have it on in the Admin page only, not on the site for users, but now it is totally gone from the admin pages, too. I just upgraded to 1,3,3. Does that have something to do with it?
Closing the browser or clearing your cookies should have brought it back. I will look into this issue and if I can find anything, I will fix it in the next release. Thanks for the bug report.
Hello, I just found your plugin today but I have to admit that I do not understand everything in the css to customize, I would just like to change the color of the bar to match my site and maybe get rid of or replace the W icon on the left. Any help you can provide would be great. Thanks
To make these changes you will need to learn some CSS. A good place to start would be http://css-tricks.com
Agreed. Context is key.For example, last week at WordCamp Philly Jason Coleman dleveoped a plugin during the event called . It allows for disabling of the visual editor on a post by post basis. In a discussion about how to go about the plugin, instead of adding another metabox to the posting screen, it was decided that moving the controls to the Screen Options would make more sense. So, the plugin avoided adding yet another metabox to the screen, and moved the controls to a place that people look to make changes to the way WordPress screens operate. Win win.
Hello and thx for this plugin it will be awsome if i will setup corectly to disable this bar forever :)
Now i`m new on wordpres just 1 week i have a membes only sit with theme ondemand1.0 and i realy dont know how to disable for all users and forever this bar
Can you write the text that i ned to put in and what to replace and in what comand thx in advance
Another thing can i disble for all user forever and compleatly and the admin stil havit
If you dont want to write here you can email me man i`m want that f..g bar of from the usrs :)
Navigate to `/wp-admin/options-general.php?page=custom-adminbar-options-menu` and change the settings so that only the administrator checkbox is checked.
Also if all plugin autohrs just added an Action Link to their plugin on the actual Plugins page, admins wouldn’t have so much trouble finding the new Settings screens. At the bottom of the article I linked above (I won’t link again) there is a link to a different slightly outdated but useful article showing how to do just that.
@Tracy Thanks for the good input, I will get that added for the next release.
FYI for anyone else, there is a link in the Settings menu.
Does this plugin work with multisite? It doesn’t seem to for me.
No the plugin does not support multisite…sorry.