Disable Wordpress Admin Bar for All Users Except Administrators

/ Published in: PHP
Save to your folder(s)

Add the line of code to your theme's function.php file

Copy this code and paste it in your HTML
  1. function my_function_admin_bar($content) {
  2. return ( current_user_can("administrator") ) ? $content : false;
  3. }
  4. add_filter( 'show_admin_bar' , 'my_function_admin_bar');

URL: http://priyankvira.com

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.