Add Custom User Roles
-
Hi everyone,
I’m working on creating some custom user roles and I was wondering if I could get assistance with it, because the code I modified kind of killed my site (so I took it out and it’s working fine again).
I’m running a guild website, so we have specific titles (in order from left to right for hierarchy):
Advisor (Keymaster) > Councilman (Moderator) > Artisan (Moderator) > Adept (Participant) > Journeyman (Participant) > Craftsman (Participant) > Apprentice (Participant)I was trying to follow this guide: http://codex.bbpress.org/custom-capabilities/
/* bbPress Custom Roles */ function add_custom_role( $bbp_roles ) { $bbp_roles['my_custom_role1'] = array( 'name' => 'Apprentice', 'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants ); $bbp_roles['my_custom_role2'] = array( 'name' => 'Craftsman', 'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants ); $bbp_roles['my_custom_role3'] = array( 'name' => 'Journeyman', 'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants ); $bbp_roles['my_custom_role4'] = array( 'name' => 'Adept', 'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants ); $bbp_roles['my_custom_role5'] = array( 'name' => 'Artisan', 'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() ) // the same capabilities as keymaster ); $bbp_roles['my_custom_role6'] = array( 'name' => 'Councilman', 'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() ) // the same capabilities as keymaster ); $bbp_roles['my_custom_role7'] = array( 'name' => 'Advisor', '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 ); /* bbPress Custom Roles */
Can someone tell me where I might have gone wrong?
Thanks in advance! 😀
- You must be logged in to reply to this topic.