tekgazet (@tekgazet)

Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • @tekgazet

    Participant

    Sure. I used the bbp_new_topic_pre_content Filter Hook and the code I used is as under:

     //code to limit number of characters in topic contents to 500 characters
     
    function tm_limit_topic_content( $topic_content )
    {
        /* Check for number of characters in topic contents  */
        if (strlen($topic_content) > 500) {
    		$revised_content = substr($topic_content, 0, 500);
    		}	
    	else {
    		$revised_content = $topic_content ;
    	}		
     
        return $revised_content ;
    }
     
    add_filter( 'bbp_new_topic_pre_content', 'tm_limit_topic_content' );

    @tekgazet

    Participant

    Never mind. After some trial and error, I have been able to find out the relevant filter hook and achieved the goal. Thanks.

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