Skip to content

Instantly share code, notes, and snippets.

@maxkostinevich
Created December 22, 2015 16:15
Show Gist options
  • Save maxkostinevich/d133177dfe746fa064b7 to your computer and use it in GitHub Desktop.
Save maxkostinevich/d133177dfe746fa064b7 to your computer and use it in GitHub Desktop.
bbPress: User Roles Custom Titles
<?php
add_filter( 'bbp_get_dynamic_roles', 'my_bbp_custom_role_names');
function my_bbp_custom_role_names(){
return array(
// Keymaster
bbp_get_keymaster_role() => array(
'name' => __( 'Keymaster', 'bbpress' ),
'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() )
),
// Moderator
bbp_get_moderator_role() => array(
'name' => __( 'Moderator', 'bbpress' ),
'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() )
),
// Participant
bbp_get_participant_role() => array(
'name' => __( 'Participant', 'bbpress' ),
'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() )
),
// Spectator
bbp_get_spectator_role() => array(
'name' => __( 'Spectator', 'bbpress' ),
'capabilities' => bbp_get_caps_for_role( bbp_get_spectator_role() )
),
// Blocked
bbp_get_blocked_role() => array(
'name' => __( 'Blocked', 'bbpress' ),
'capabilities' => bbp_get_caps_for_role( bbp_get_blocked_role() )
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment