• Resolved Drauth

    (@drauth)


    Hi,
    I need to hide the black admin bar on top to a given role.
    Is it possible? How?
    Thanks
    Simone

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Caseproof

    (@caseproof)

    Hi Drauth,

    To hide admin bar for specific roles you could add the following code snippet at the end of your theme’s functions.php file or use WP Code plugin:

    add_action( 'wp', function() {
      $user = wp_get_current_user();
    
      if ( in_array( 'your_role', $user->roles ) ) {
        show_admin_bar( false );
      }
    } );

    Remember to replace “your_role” with the role that should not see admin bar.

    Best

Viewing 1 replies (of 1 total)
  • The topic ‘Hide admin bar to a given role’ is closed to new replies.