Skip to:
Content
Pages
Categories
Search
Top
Bottom

Spectator same Capabilitys as Participant


  • Kalusha
    Participant

    @kalusha

    Hello,
    I need that the spectator had the same capabilitys as a Participant.

    Can anybody give a code for my functions.php

    That were great.

    Sorry for my English. I´m from Germany.
    Regards

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

  • Robin W
    Moderator

    @robin-w

    Can I ask why you don’t just make your spectators into participants?


    Kalusha
    Participant

    @kalusha

    Good morning,

    In my forum they have the same capability but the Name group of two i needed. The forum is only one Part of my site.
    Did you have an idea for the Code?
    Thanks a lot


    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_change_caps', 10 , 2) ;
    
    function rew_change_caps ($caps, $role) {
    	// Which role are we looking for?
    	switch ( $role ) {
    	case bbp_get_spectator_role()   :
    			$caps = array(
    
    				// Primary caps
    				'spectate'              => true,
    				'participate'           => true,
    
    				// Forum caps
    				'read_private_forums'   => true,
    
    				// Topic caps
    				'publish_topics'        => true,
    				'edit_topics'           => true,
    
    				// Reply caps
    				'publish_replies'       => true,
    				'edit_replies'          => true,
    
    				// Topic tag caps
    				'assign_topic_tags'     => true,
    			);
    			break;
    	}
    return $caps ;
    }

    Kalusha
    Participant

    @kalusha

    Hey, thank you. But I become this message:

    Das Snippet wurde deaktiviert wegen einem Fehler in der Zeile 4:

    Cannot redeclare function rew_change_caps.

    It doesn´t work

    regards


    Robin W
    Moderator

    @robin-w

    my guess would be that you have pasted this twice into the snippet or created 2 snippets in error

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