Page 1 of 1

Removing the Admin bar for members

PostPosted: March 28th, 2011, 10:22 pm
by drbyte
Hey Jason

Maybe you can have an option to remove the WP top admin/user bar in your next release...Not sure why WP don't have an option for that but I find it really annoying....and somehow branding your site as everybody else.

I know you can remove it by editing each user option but If you have thousands it will be impossible unless you inject the db....

Here is a temp solution i found but It would be nice if you can come up with something..

in your functions.php

add this line on top

Code: Select all
<?php
function my_function_admin_bar($content) {
    return ( current_user_can("administrator") ) ? $content : false;
}
add_filter( 'show_admin_bar' , 'my_function_admin_bar');
?>


that will remove the top admin bar to all users...Not for the admin...this way you still have access to it's usability

Sam

P.S. Please look into my other post Jason...Thank you
http://www.primothemes.com/forums/viewtopic.php?f=4&t=2838

Re: Removing the Admin bar for members

PostPosted: March 28th, 2011, 11:19 pm
by Cristián Lávaque
Thank you drbyte! :)

I had also wanted to solve this problem before and Jason showed me this plugin that removes it https://wordpress.org/extend/plugins/disable-admin-bar/

Re: Removing the Admin bar for members

PostPosted: August 31st, 2011, 12:32 am
by 16k_zx81
Christian is this still the preferred solution for S2M to remove the Admin Bar for non-Admin members?

Re: Removing the Admin bar for members

PostPosted: August 31st, 2011, 8:25 pm
by Cristián Lávaque
It's not that it's preferred by s2Member, it's just that s2Member doesn't deal with that. That's the plugin I'm using to remove the bar in one of my websites and it works.

I hope that helps. :)

Re: Removing the Admin bar for members

PostPosted: August 31st, 2011, 8:31 pm
by 16k_zx81
Yes it does :) Thats all I needed to know

Thanks Christian

Re: Removing the Admin bar for members

PostPosted: September 1st, 2011, 1:20 pm
by Cristián Lávaque
Cool. :)

Re: Removing the Admin bar for members

PostPosted: November 22nd, 2011, 2:25 pm
by weblantis
I found that this also works really well:

http://wordpress.org/extend/plugins/wp- ... admin-bar/

It lets you enable/disable admin on user level by level basis.

Re: Removing the Admin bar for members

PostPosted: November 22nd, 2011, 3:17 pm
by 16k_zx81
ah thats brilliant!

I had it disabled, because I didnt know of any other option

this fixes the problem and I can have my admin bar back now when using the site

thanks a heap for posting!