bbp_topic_form_fields()

Output the required hidden fields when creating/editing a topic

Description

Source

File: bp-forums/common/template.php

1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
function bbp_topic_form_fields() {
 
    if ( bbp_is_topic_edit() ) : ?>
 
        <input type="hidden" name="action"       id="bbp_post_action" value="bbp-edit-topic" />
        <input type="hidden" name="bbp_topic_id" id="bbp_topic_id"    value="<?php bbp_topic_id(); ?>" />
 
        <?php
 
        if ( current_user_can( 'unfiltered_html' ) )
            wp_nonce_field( 'bbp-unfiltered-html-topic_' . bbp_get_topic_id(), '_bbp_unfiltered_html_topic', false );
 
        ?>
 
        <?php wp_nonce_field( 'bbp-edit-topic_' . bbp_get_topic_id() );
 
    else :
 
        if ( bbp_is_single_forum() ) : ?>
 
            <input type="hidden" name="bbp_forum_id" id="bbp_forum_id" value="<?php bbp_forum_id(); ?>" />
 
        <?php endif; ?>
 
        <input type="hidden" name="action" id="bbp_post_action" value="bbp-new-topic" />
 
        <?php if ( current_user_can( 'unfiltered_html' ) )
            wp_nonce_field( 'bbp-unfiltered-html-topic_new', '_bbp_unfiltered_html_topic', false ); ?>
 
        <?php wp_nonce_field( 'bbp-new-topic' );
 
    endif;
}

Changelog

Changelog
Version Description
bbPress (r2753) Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.