Skip to:
Content
Pages
Categories
Search
Top
Bottom

BBpress 2.5.4 custom roles trouble


  • arno8
    Participant

    @arno8

    Hi everyone, i was wondering what i’m doing wrong here..
    I added 13 new roles in my themes functions.php, but when i try to assign them to my users it obly shows a few of them..

    img

    functions.php code

    function add_custom_role( $bbp_roles ) {
      $bbp_roles['my_custom_role'] = array( 
        'name' => 'Recruit',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
      $bbp_roles['my_custom_role'] = array( 
        'name' => 'Corporal',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
        $bbp_roles['my_custom_role'] = array( 
        'name' => 'Sergeant',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
        $bbp_roles['my_custom_role'] = array( 
        'name' => 'Lieutenant',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
        $bbp_roles['my_custom_role'] = array( 
        'name' => 'Captain',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
        $bbp_roles['my_custom_role'] = array( 
        'name' => 'General',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
        $bbp_roles['my_custom_role'] = array( 
        'name' => 'Admin',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
        $bbp_roles['my_custom_role'] = array( 
        'name' => 'Organiser',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
        $bbp_roles['my_custom_role'] = array( 
        'name' => 'Coordinator',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
        $bbp_roles['my_custom_role'] = array( 
        'name' => 'Overseer',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
        $bbp_roles['my_custom_role'] = array( 
        'name' => 'Deputy Owner',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
      
       $bbp_roles['my_custom_role'] = array( 
        'name' => 'Owner',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
      
        $bbp_roles['my_custom_role'] = array( 
        'name' => 'Clan Wars Leader',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
      
      return $bbp_roles;
    }   
    add_filter( 'bbp_get_dynamic_roles', 'add_custom_role', 1 );

    Anyone has an idea?

    also how can i add images in front of the names? small icons like this: img

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

  • Robin W
    Moderator

    @robin-w

    Yes, each of your

    ['my_custom_role']

    needs to be different, otherwise it’s just overwriting each time, which is why only the last one shows
    eg my_custom_role1 my_custom_role2

    giving

    $bbp_roles['my_custom_role1>'] = array( 
        'name' => 'Recruit',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
      
      $bbp_roles['my_custom_role2'] = array( 
        'name' => 'Corporal',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // i just want them to have the same capabilities as participants
    
      );
    
    

    arno8
    Participant

    @arno8

    Ahh your right, and what about the images?


    Robin W
    Moderator

    @robin-w

    images are doable, but you’d need code that is beyond the free help on here


    arno8
    Participant

    @arno8

    pity 🙁


    arno8
    Participant

    @arno8

    .


    Flash Buddy
    Participant

    @flashbuddy

    could you add to you template

    if (!empty($userrole_blabbermouth))
    {
    echo “< img src=”path to image” / >”;
    }
    else { echo “”;}


    arno8
    Participant

    @arno8

    where do i place it? and do i change the blabbermouth to my custom role name?

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