Skip to content Skip to main menu
User Role Editor
Menu
  • Home
  • Prices
  • Download
  • Testimonials
  • Forums
  • Blog
  • ChangeLog
  • Documentation
  • Login
Home › Reply › Reply To: How to restrict top bar

Change WordPress user roles and capabilities › Forums › How to or FAQ › How to restrict top bar › Reply To: How to restrict top bar

10/04/2015 at 17:56 #1447
Vladimir
Keymaster

Hi,

add to the active theme’s functions.php file this code:


add_action('wp_head', my_hide_admin_menu_bar);

function my_hide_admin_menu_bar() {
       
    if (current_user_can('role_for_which_you_block_admin_bar')) {
        show_admin_bar(false);
    }        
        
}

Recent Topics

  • Administrator menu access module is not working on a multisite
  • New custom role capabilities not saved
  • How to use the paid version of plugin?
  • view_dashboard is no longer available?
  • User Role Editor Pro Not Restricting Forms Based on User Roles – Need Help
  • Use Automation to import a URE Pro Export File
  • Global Role Updates Not Syncing to Subsites in Multisite
  • Issue with Page View Access for Non-Logged In Users
  • Can’t add an image using Divi
  • MonsterInsights access capacity for user role

Recent Replies

  • [email protected] on Administrator menu access module is not working on a multisite 14 hours, 30 minutes ago
  • Vladimir on Administrator menu access module is not working on a multisite 14 hours, 56 minutes ago
  • [email protected] on Administrator menu access module is not working on a multisite 15 hours, 7 minutes ago
  • Vladimir on Administrator menu access module is not working on a multisite 1 day, 23 hours ago
  • Andy Burns on Multisite – Capabilities reset when restricting access to a plugin 3 days, 5 hours ago
  • Vladimir on Multisite – Capabilities reset when restricting access to a plugin 3 days, 12 hours ago
  • Andy Burns on Multisite – Capabilities reset when restricting access to a plugin 5 days, 11 hours ago
  • Vladimir on How to make a plugin visible for non admins 6 days, 23 hours ago
  • [email protected] on How to make a plugin visible for non admins 1 week ago
  • Vladimir on Multisite – Capabilities reset when restricting access to a plugin 1 week ago
  • Contact Us
  • Privacy Policy
  • Terms of use (EULA)
© 2010 - 2026 Role-editor.com Contact: hd@role-editor.com
Share