Skip to:
Content
Pages
Categories
Search
Top
Bottom

Custom Role not working..


  • st11
    Participant

    @st11

    I am trying to create a custom role that can only reply to existing topics.

    I followed this to create new role. At first, the role did appear in dropdown list in admin edit user screen, but after saving, it went back to “— No role for these forums —”.

    I found this thread, so.. I created custom WordPress role in the same name. This made the bbPress role to be “saved” but it doesn’t seem to add capabilities. The user with this role can’t see forum or topics.

    How can I get this custom bbPress user role to have custom capability?

    WordPress 5.5, bbPress 2.6.6

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

  • st11
    Participant

    @st11

    It worked if I set capabilities when creating custom role.

    function add_wp_custom_roles() {
        add_role(
            "bbp_member",
            "Member",
            [
    		"read"=>true,
    
    		"spectate"=>true,
    		"participate"=>true,
    		"read_private_forums"=>true,
    		"publish_replies"=>true,
    		"edit_replies"=>true,
    	    ]);
    }
    add_action("init", "add_wp_custom_roles");
    

    neon67
    Participant

    @neon67

    perfectly!
    phs 4 sharing

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