yes, go to
Layout and functionality – Examples you can use
and no. 15 if you want to change capabilities
hmm seems the formatting for that code in 14 is not quite right
$bbp_roles['my_custom_role1'] = array(
'name' => 'name 1',
'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
);
is => supposed to be => (just from other examples I’v seen in other posts)
it also spat errors at me with the extra empty lines between the lines of code.
Either way here is the code that works might be worth updating the codex thing
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 );
Thanks heaps for your help 🙂
Now to play around with this and the capabilities.
Thanks, the editor has a habit of changing => and adding lines as you save it, so yes i’ll update.
@star100
Layout and functionality – Examples you can use
no. 14 & 15
@bob1nz
Thanks, I’ve updated the codex, as I say it doesn’t like switching between visual and text, and alters the code if you do. Sop thanks again it should now read correctly