bbPress custom themes not saving
-
FYI I’m using version 4.9.6 of wordpress and version 2.5.14 of bbPress.
I added custom code to my theme functions.php page to add customized roles for bbPress. The roles show up when I edit users and want to change their roles, but when I go to save it, they just default back to a participant role. How can I fix this? Here is the code I used below:
/* bbPress Custom Roles */ function add_custom_role( $bbp_roles ) { $bbp_roles['my_custom_role2'] = array( 'name' => 'Producer', 'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants ); $bbp_roles['my_custom_role3'] = array( 'name' => 'Engineer', 'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants ); $bbp_roles['my_custom_role4'] = array( 'name' => 'Songwriter', 'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants ); $bbp_roles['my_custom_role5'] = array( 'name' => 'Staff', 'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() ) // the same capabilities as keymaster ); $moderator = bbp_get_moderator_role() ; $bbp_roles[$moderator] = array( 'name' => 'Moderator', 'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() ) // the same capabilities as keymaster ); $keymaster = bbp_get_keymaster_role() ; $bbp_roles[$keymaster] = array( 'name' => 'Chief Executive Officer', 'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() ) // the same capabilities as keymaster ); $apprentice = bbp_get_participant_role() ; $bbp_roles[$apprentice] = array( 'name' => 'Member', 'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants ); return $bbp_roles; } add_filter( 'bbp_get_dynamic_roles', 'add_custom_role', 1 );
- You must be logged in to reply to this topic.