How to get the Role Name of the current user? (WordPress)
I’m not sure if bbPress follows WordPress conventions, but WP has a global class called $WP-roles that holds the role information. So, starting from what you have, there is the role of the current user: $current_role = $user->roles[1]; Next, retrieve a list of all roles: $all_roles = $wp_roles->roles; Then, loop through $all_roles and find the … Read more