olliewe88 (@olliewe88)

Forum Replies Created

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

  • olliewe88
    Participant

    @olliewe88

    I just clicked on users in wordpress @robin-w


    olliewe88
    Participant

    @olliewe88

    @robin-w

    1. When I go back to the user it says no role for these forums, but at the bottom it says

    Additional Capabilities
    Capabilities bbp_Facepainter

    2. The second screen-shot is after I update the user.


    olliewe88
    Participant

    @olliewe88

    http://postimg.org/image/u6h4ockpd/
    However when I go to users in word press it still doesn’t show that their role is facepainter?


    olliewe88
    Participant

    @olliewe88

    Afternoon @robin-w

    http://postimg.org/image/jiddpiaq9/
    As you can see in the image above I set the forum role to Facepainter

    http://postimg.org/image/ukigny4sx/
    Then I save it


    olliewe88
    Participant

    @olliewe88

    hi again @robin-w

    Ok so I have put the code below in the functions.php

    function add_new_roles( $bbp_roles )
    {
    /* role the new role*/
    $bbp_roles[‘bbp_Facepainter’] = array(
    ‘name’ => ‘Facepainter’,
    ‘capabilities’ => custom_capabilities( ‘bbp_Facepainter’ )
    );

    return $bbp_roles;
    }

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

    function add_role_caps_filter( $caps, $role )
    {
    /* Only filter for roles we are interested in! */
    if( $role == ‘bbp_Facepainter’ )
    $caps = custom_capabilities( $role );

    return $caps;
    }

    add_filter( ‘bbp_get_caps_for_role’, ‘add_role_caps_filter’, 10, 2 );

    function custom_capabilities( $role )
    {
    switch ( $role )
    {

    /* Capabilities for ‘Facepainter’ role */
    case ‘bbp_Facepainter’:
    return array(
    // Primary caps
    ‘spectate’ => true,
    ‘participate’ => true,
    ‘moderate’ => false,
    ‘throttle’ => false,
    ‘view_trash’ => false,

    // Forum caps
    ‘publish_forums’ => false,
    ‘edit_forums’ => false,
    ‘edit_others_forums’ => false,
    ‘delete_forums’ => false,
    ‘delete_others_forums’ => false,
    ‘read_private_forums’ => true,
    ‘read_hidden_forums’ => false,

    // Topic caps
    ‘publish_topics’ => true,
    ‘edit_topics’ => true,
    ‘edit_others_topics’ => false,
    ‘delete_topics’ => false,
    ‘delete_others_topics’ => false,
    ‘read_private_topics’ => true,

    // Reply caps
    ‘publish_replies’ => true,
    ‘edit_replies’ => true,
    ‘edit_others_replies’ => false,
    ‘delete_replies’ => false,
    ‘delete_others_replies’ => false,
    ‘read_private_replies’ => true,

    // Topic tag caps
    ‘manage_topic_tags’ => false,
    ‘edit_topic_tags’ => false,
    ‘delete_topic_tags’ => false,
    ‘assign_topic_tags’ => true,
    );

    break;

    default :
    return $role;
    }
    }}

    However, it is still not working. It shows when I go to Users,user,Forum Role and set it to facepainter but when I save it, it still doesn’t set their fourm role to face painter?!

    Thanks for you help


    olliewe88
    Participant

    @olliewe88

    Custom Capabilities

    Thank you however for the link above where do you find the code to edit @robin-w

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