How to rename bbpress user roles

The wordpress forum plugin bbpress provides 5 default user roles. User roles in wordpress allow to define page rights and to restrict the possibilites for user groups.

In this tutorial I show you how to rename the default user role names for your bbpress forum.

What are the default bbpress user role names?

  • Keymaster (like a forum admin)
  • Moderator (forum manager)
  • Participant (normal user)
  • Spectator (cant engage)
  • Blocked (everything is blocked)

How to change the bbpress user role names:

Add the code below to the end of your functions.php file.
This creates a filter for custom role names.

 /* BBPress Renaming Roles */
add_filter( 'bbp_get_dynamic_roles', 'ntwb_bbpress_custom_role_names' );
function ntwb_bbpress_custom_role_names() {
return array(
// Keymaster
bbp_get_keymaster_role() => array(
'name' => 'New Name for Keymaster',
'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() )
),
// Moderator
bbp_get_moderator_role() => array(
'name' => 'New Name for Moderator',
'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() )
),
// Participant
bbp_get_participant_role() => array(
'name' => 'New Name for Participant',
'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() )
),
// Spectator
bbp_get_spectator_role() => array(
'name' => 'New Name for Spectator',
'capabilities' => bbp_get_caps_for_role( bbp_get_spectator_role() )
),
// Blocked
bbp_get_blocked_role() => array(
'name' => 'New Name for Blocked',
'capabilities' => bbp_get_caps_for_role( bbp_get_blocked_role() )
));}

The grey comments show you where you can change each user role.
If there are user roles you don’t want to change, then you can delete the lines.

For example on one of my pages called ‘siQ-Gaming’ I renamed the participant to ‘siQ Member’.
Sounds cool and fits the forum much more!

That’s it – if you got any questions about it, feel free to ask!
– Kev

Leave a Reply

avatar
Nessa
Guest

Cool I got it

wpDiscuz