Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Titles – Roles

@robin-w

Moderator

ok, just tested and this code seems to work

function add_custom_role( $bbp_roles ) {
 $bbp_roles['my_custom_role1'] = array(
'name' => 'name 1',
'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants

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

);

 $bbp_roles['my_custom_role3'] = array(
'name' => 'name 3',
'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() ) // the same capabilities as keymaster

);

return $bbp_roles;
 }
 add_filter( 'bbp_get_dynamic_roles', 'add_custom_role', 1 );

So this adds 3 roles, you/your experts can duplicate the code and add more or remove unnecessary.

Basically you’ll just need to

1. tell the what to put as the names – currently the new roles are name 1, Name2 and name 3 (where it says ‘name’ => ‘name 1’ , so they’ll just overwrite that with what you want.

2. for each what capability. You’ll see the first two have the code bbp_get_participant_role() so that sets them to participant and the last sets to keymaster using bbp_get_keymaster_role() . You can guess that you just change the words for other roles such as spectator, or moderator.

They need to add this to your theme’s functions file.

please come back if any of this is not clear

Skip to toolbar