Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbp_participant is uneditable


  • danielbush3
    Participant

    @danielbush3

    I would like to change the function that participants are automatically given the rights to publish, create and edit topics.

    I want the topics to be controlled by the administrator and participants are only able to reply to existing ones.I used the plugin WPFront User Role Editor and selected Override Role Edit Permissions to get access to the role settings, but when I go to the role and deselect the tick box on the aforementioned items after saving it defaults back to as it was.

    Is there any way of changing this whist avoiding code. If not what happens to the code after an update?

    Thanks in advance.

Viewing 1 replies (of 1 total)

  • Robin W
    Moderator

    @robin-w

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets

    add_filter( 'bbp_get_caps_for_role', 'rew_amend_role_caps', 10, 2 );
     
    function rew_amend_role_caps( $caps, $role ) {
        if ($role=='bbp_participant' ) {
                $caps = array(
    
    				// Primary caps
    				'spectate'              => true,
    				'participate'           => true,
    
    				// Forum caps
    				'read_private_forums'   => true,
    
    				// Topic caps
    				'publish_topics'        => false,
    				'edit_topics'           => false,
    
    				// Reply caps
    				'publish_replies'       => true,
    				'edit_replies'          => true,
    
    				// Topic tag caps
    				'assign_topic_tags'     => true,
    			);
    	}
    			
    	return $caps ;		
     
    }
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar