I currently have this snippet:
$user = new WP_User(get_current_user_id());
echo $user->roles[1];
and the output the slug of the bbPress forum role. (roles[0] would be the general WP role but I don't need that.)
What I need is the role name, not the slug. So, the expected output should be something like "Keymaster", "Participant", "Spectator" etc.
So, how do I get the Role Name of the current user?
wp_get_current_user()
should helps you. You get return all data to the user via the class ´WP_User`.