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.