Giacomo (@gcmo)

Forum Replies Created

Viewing 1 replies (of 1 total)
  • @gcmo

    Participant

    An easy way to achieve the second option would be to copy paste this code at the end of the file named functions.php in your current theme folder.

    Make sure to create a backup of the file functions.php first. And always do the changes on a test server, not the live one.

    
    function rsb_limit_posting( $retval ) {
    
    	// count topics of the current user
    	$topic_count = bbp_get_user_topic_count_raw( get_current_user_id() );
    	// if they are 10 or more, do not allow him to create new topic
    	if ( $topic_count > 9 ) return false;
    	// otherwise return the default 
    	return $retval;
    
    }
    add_filter( 'bbp_current_user_can_access_create_topic_form', 'rsb_limit_posting' );
    

    The code above hide the “new topic form” for users who posted 10 or more topics.

    Hope it helps… good luck!

Viewing 1 replies (of 1 total)