Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to set some letters in a new topic textarea by default?

  • @honeybb

    Participant

    Hello.

    I would like to set some letters only in a new topic textarea by default.

    Is it possible?

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

    Participant

    I could solve this by adding following code to function.php.

    add_filter( ‘bbp_get_the_content’, ‘amend_new_topic’, 10, 3);

    Function amend_new_topic ($output, $args, $post_content) {
    if ($args[‘context’] == ‘topic’ && $post_content == ”) $output=str_replace(‘></textarea>’, ‘>question1 question2 question3</textarea>’,$output) ;
    return $output ;
    }

    Thanks,

    @robin-w

    Moderator

    Great – glad you’re fixed, and sorry I didn’t get to you earlier.

    Also thanks for sharing the solution which will help others in future

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