Skip to:
Content
Pages
Categories
Search
Top
Bottom

Creating new custom role


  • angelfire4xx
    Participant

    @angelfire4xx

    It seems to be a real struggle to create a new custom role for bbpress 🙁
    I’ve been trying out all the different solutions I’ve found online but nothing is working.
    All I want to do is to be able to assign the role of Naturopath to some of my forum participants. They would have the same capabilities as the Participant role, just have Naturopath instead of Participant showing under their name in the Forum. The rest of the Participants can continue to show “Participant”.
    Can anyone here maybe write the code for me as a paid job?
    I have WP 5.8.1
    bPress 2.6.6

Viewing 3 replies - 1 through 3 (of 3 total)

  • Robin W
    Moderator

    @robin-w

    contact me via

    Contact me


    Keith_Saunders
    Participant

    @keith_saunders

    I have the same issue which I have been trying to find a solution for days now.

    Like angelfire4xx I just want to create roles for Gold, Silver and Bronze members.

    Like others I have scanned lots of posts and documentation and tried various suggestions.

    I have in my child functions the following which I did manage to actually create roles, but they did not work using the following code

    function add_custom_role( $bbp_roles ) {

    $bbp_roles[‘BRONZE Member’] = array(
    ‘name’ => ‘BRONZE Member’,
    ‘capabilities’ => bbp_get_caps_for_role( bbp_get_participant_role() ));

    $bbp_roles[‘SILVER Member’] = array(
    ‘name’ => ‘SILVER Member’,
    ‘capabilities’ => bbp_get_caps_for_role( bbp_get_participant_role() ));

    $bbp_roles[‘GOLD Member’] = array(
    ‘name’ => ‘GOLD Member’,
    ‘capabilities’ => bbp_get_caps_for_role( bbp_get_participant_role() ));

    return $bbp_roles;
    }

    add_filter( ‘bbp_get_dynamic_roles’, ‘add_custom_role’, 1 );

    When I installed the “Members” plugin it told me the following

    Warning: Undefined array key “bronze_member” in /homepages/17/d531871193/htdocs/clickandbuilds/BeoworldForum/wp-content/plugins/members/inc/functions-roles.php on line 257

    for each of the created custom roles, hence why it does not work.

    Can anyone suggest a way forward other than what is already been posted.


    Robin W
    Moderator

    @robin-w

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar