Skip to:
Content
Pages
Categories
Search
Top
Bottom

How can I remove the limit on topic title


  • kikismedia
    Participant

    @kikismedia

    Is there a way to this and also how can I truncate topic content limit (like reduce the content limit)

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

  • Robin W
    Moderator

    @robin-w

    This allows any length title

    add_filter( 'bbp_is_title_too_long', 'rew_dont_bother', 10 , 4 ) ;
    
    function rew_dont_bother ($result, $title, $max, $len ){
    	return false ;
    }

    and this reduces content

    //code to limit number of characters in topic contents to 500 characters
    add_filter( 'bbp_new_topic_pre_content', 'rew_limit_topic_content' );
    add_filter( 'bbp_edit_topic_pre_content', 'rew_limit_topic_content' );
    
    function rew_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 ;
    }

    Put this in your child theme’s function file – or use

    Code Snippets


    kikismedia
    Participant

    @kikismedia

    Thanks robin

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