Have you heard about user roles in WordPress? With these roles, you can create a hierarchy of permissions, so each user has access to exactly what they need to have access to.
Keymaster is a role in bbPress and BuddyPress, in many ways similar to Admin’s role in WordPress.
In this article, we would like to talk about WordPress keymaster.
What is WordPress Keymaster?
In WordPress, each user can have a specific role and based on their role they can access different sections of a WordPress website. For example, the administrator has the highest permission there is in WordPress. They can access any configurations and features.
But what is WordPress keymaster? Keymaster is a user role similar to the administrator but it is designed specifically for bbPress and BuddyPress. However, keep in mind, by installing keymaster plugins, a new user role will be added to your website as well.
User Roles in bbPress
bbPress is a WordPress plugin for creating forums. By using this feature, you can define user access to a different section of WordPress. bbPress user roles are similar to WordPress user roles.
User roles in WordPress are:
- Administrator
- Editor
- Author
- Subscriber
- Contributor
It’s the same in bbPress, each user can have its own user roles. Main roles and default roles in bbPress are:
- Keymaster: This user can delete, edit topics, and create new forums. Keymaster can also manage tags and limit forms. This user has access to most of the configuration settings.
- Administrator: A user with administrator privileges in bbPress. The administrator can create and edit forums. Also, he can delete or edit other users’ answers in a post. The administrator can manage tags limit forms with the available tools.
- Subscriber: This user can only create and edit their answers.
- Visitor: This user can only read threads and answers, and cannot make any changes to anything.
- Banned: In this role, all of the accessibility is blocked and they can’t do anything nor read anything on the website.
How to Give Keymaster Role to Another User?
By default, the administrator of bbPress is the keymaster. But what if we want to assign someone else as a keymaster?
To assign a user to be keymaster, follow the steps below:
- Login to WordPress Dashboard
- Go to Users > All Users
- Select the desired user
- From toolbar and a drop-down menu of user roles select keymaster
- Finally, click on save changes.
How to Rename WordPress Keymaster?
If you’re looking for a way to rename WordPress keymaster, follow the steps below:
1. Before anything, we recommend making any changes to the child theme. In case it causes any issues, you can restore back to the original state.
2. Open the function.php file of the child theme.
3. Add the following code to it:
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’ => ‘My Custom Keymaster Role Name’,
‘capabilities’ => bbp_get_caps_for_role( bbp_get_keymaster_role() )
),
// Moderator
bbp_get_moderator_role() => array(
‘name’ => ‘My Custom Moderator Role Name’,
‘capabilities’ => bbp_get_caps_for_role( bbp_get_moderator_role() )
),
// Participant
bbp_get_participant_role() => array(
‘name’ => ‘My Custom Participant Role Name’,
‘capabilities’ => bbp_get_caps_for_role( bbp_get_participant_role() )
),
// Spectator
bbp_get_spectator_role() => array(
‘name’ => ‘My Custom Spectator Role Name’,
‘capabilities’ => bbp_get_caps_for_role( bbp_get_spectator_role() )
),
// Blocked
bbp_get_blocked_role() => array(
‘name’ => ‘My Custom Blocked Role Name’,
‘capabilities’ => bbp_get_caps_for_role( bbp_get_blocked_role() )
)
);
}
4. Replace “My Custom Blocked Role Name” to any name you want to rename keymaster to.
5. Finally, make sure you save the changes.
Conclusion
In this article, we talked about WordPress keymaster role in WordPress and bbPress. In addition, we discussed how to rename the keymaster role via a simple piece of code that you have to add to your functions.php of the child theme you have created. Also, we discussed how to assign keymaster to a user in WordPress.