esportsstream (@esportsstream)

Forum Replies Created

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

  • esportsstream
    Participant

    @esportsstream

    Ok do to fix it i had to write that code in the actual funtions.php file of my main theme


    esportsstream
    Participant

    @esportsstream

    I use bulletpress as my theme. I have tried all sorts of directories and have not gotten anything to work 🙁


    esportsstream
    Participant

    @esportsstream

    So i made a new file called bbpress-functions.php and put this into it

    <?php
    //code to add tutor role 
    
    function add_apply_role( $bbp_roles )
    {
    	/* Add a role called apply */
    	$bbp_roles['bbp_apply'] = array(
    		'name' => 'apply',
    		'capabilities' => custom_capabilities( 'bbp_apply' )
    		);
    	return $bbp_roles;
    }
     
    add_filter( 'bbp_get_dynamic_roles', 'add_apply_role', 1 );
    
    function apply_role_caps_filter( $caps, $role )
    {
    	/* Only filter for roles we are interested in! */
    	if( $role == 'bbp_apply' )
    		$caps = custom_capabilities( $role );
     
    	return $caps;
    }
     
    add_filter( 'bbp_get_caps_for_role', 'apply_role_caps_filter', 10, 2 );
    
    function custom_capabilities( $role )
    {
    	switch ( $role )
    	{
    		 
    		/* Capabilities for 'apply' role */
    		case 'bbp_apply':
    			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'   => false,
    				'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'   => false,
     
    				// Reply caps
    				'publish_replies'       => true,
    				'edit_replies'          => true,
    				'edit_others_replies'   => false,
    				'delete_replies'        => false,
    				'delete_others_replies' => false,
    				'read_private_replies'  => false,
     
    				// Topic tag caps
    				'manage_topic_tags'     => false,
    				'edit_topic_tags'       => false,
    				'delete_topic_tags'     => false,
    				'assign_topic_tags'     => true,
    			);
    			break;
     
    		default :
    			return $role;
    	}
    }
    

    I have no idea where i put this file in my site directory……


    esportsstream
    Participant

    @esportsstream

    uhh ok I found the funtions.php file but i have no idea how to change it to spectators can post. Can someone please help


    esportsstream
    Participant

    @esportsstream

    From what i can gather all i have to do is change the permissions in thefuntions.php file.
    Can someone tell me where this is located?

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