Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Display user_role not bbp-author-role

@demonboy

Participant

OK, I think I have solved this by following this thread, except I had to do one thing the other way around…

1. Scrap User Role Editor and install the Members plugin by Justin Tadlock
2. Don’t put anything in your functions file
3. In WordPress under Users/Roles, clone the Participant user role and give it a name and slug (in my case I am using ‘bosun’) and save the new role.
4. Add this code to your functions file:

function vip_add_custom_role( $bbp_roles ) {

$bbp_roles['bosun'] = array(
'name' => 'Bosun',
'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
);

return $bbp_roles;
}

add_filter( 'bbp_get_dynamic_roles', 'vip_add_custom_role', 1 );

… where bbp_roles and name is changed to your own name of the user role. This must be the same as the name/slug you inserted when cloning the participant user role.

5. Now any forum user assigned this user role will display the correct role, rather that ‘participant’ ‘subscriber’ or ‘spectator’.

The thing I had to do the other way around from the instructions in the other thread was to not put anything in the functions file and install the plugin first.

Phew. Took me two days to get there!

Skip to toolbar