Buddypress bbPress add text before topic form content, bbp_theme_before_topic_form_content

Home Forums BulletProof Security Pro Buddypress bbPress add text before topic form content, bbp_theme_before_topic_form_content

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #12959
    AITpro Admin
    Keymaster

    bbPress has 2 actions that you can hook into in the form-topic.php file to add text or whatever else you want after the Topic Title and before the Topic Form.

    /bbpress/templates/default/bbpress/form-topic.php Code line 79.

    <?php do_action( 'bbp_theme_after_topic_form_title' ); ?>
    
    <?php do_action( 'bbp_theme_before_topic_form_content' ); ?>

    Example Usage is the note below about using “pre” tags in this Forum:

    If you are posting code please click on the Editor’s Text tab and add the <pre> HTML tag before your code and the </pre> HTML tag after your code.
    Example: <pre> your code goes here </pre>

    What, where and how

    Add this code below to your Theme’s functions.php file

    Hook/Action For the bbPress Topic Form

    add_action( 'bbp_theme_before_topic_form_content', 'example_topic_form_text' );
    
    // Text after the Topic Title and before the Topic Form WYSIWYG Form Editor
    function example_topic_form_text() {
    echo 'If you are posting code please click on the Editor\'s Text tab and add the &lt;pre&gt; HTML tag before your code and the &lt;/pre&gt; HTML tag after your code.<br><strong>Example: &lt;pre&gt; your code goes here &lt;/pre&gt;</strong>';
    }

    Hook/Action For the bbPress Reply Form

    add_action( 'bbp_theme_before_reply_form_content', 'example_reply_form_text' );
    
    // Text after the Reply Title and before the Reply Form WYSIWYG Form Editor
    function example_reply_form_text() {
    echo 'If you are posting code please click on the Editor\'s Text tab and add the &lt;pre&gt; HTML tag before your code and the &lt;/pre&gt; HTML tag after your code.<br><strong>Example: &lt;pre&gt; your code goes here &lt;/pre&gt;</strong>';
    }
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.