Denied ‘Participant’ User Role to Dashboard

Home Forums WordPress Denied ‘Participant’ User Role to Dashboard

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2719
    Techy Online
    Keymaster

    Hello,

    I’m looking for a way to denied the ‘Participant’ user role the access to the dashboard /wp-admin

    I’ve looked all over google and I haven’t found a complete solution. Can someone help me by pointing me into the right direction.

    I’ve used user role plugins and they aren’t registering the user roles.

    Thank you in advance

    #2721
    Techy Online
    Keymaster
    
    
    add_action(‘after_setup_theme’, ‘remove_admin_bar’);
    
    function remove_admin_bar() {
    $user_id = get_current_user_id() ;
    $role -= bbp_get_user_display_role($user_id) ;
    if (role == ‘bbp_participant’ {
    show_admin_bar(false);
    }
    }
    

    BEST ANSWER

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.