bbp_topic_form_fields

Output the required hidden fields when creating/editing a topic.

Description

bbp_topic_form_fields(); 

Usage

  1. if ( !function_exists( 'bbp_topic_form_fields' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/common/template.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bbp_topic_form_fields(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/common/template.php  
  1. function bbp_topic_form_fields() { 
  2.  
  3. if ( bbp_is_topic_edit() ) : ?> 
  4.  
  5. <input type="hidden" name="action" id="bbp_post_action" value="bbp-edit-topic" /> 
  6. <input type="hidden" name="bbp_topic_id" id="bbp_topic_id" value="<?php bbp_topic_id(); ?>" /> 
  7.  
  8. <?php 
  9.  
  10. if ( current_user_can( 'unfiltered_html' ) ) 
  11. wp_nonce_field( 'bbp-unfiltered-html-topic_' . bbp_get_topic_id(), '_bbp_unfiltered_html_topic', false ); 
  12.  
  13. ?> 
  14.  
  15. <?php wp_nonce_field( 'bbp-edit-topic_' . bbp_get_topic_id() ); 
  16.  
  17. else : 
  18.  
  19. if ( bbp_is_single_forum() ) : ?> 
  20.  
  21. <input type="hidden" name="bbp_forum_id" id="bbp_forum_id" value="<?php bbp_forum_id(); ?>" /> 
  22.  
  23. <?php endif; ?> 
  24.  
  25. <input type="hidden" name="action" id="bbp_post_action" value="bbp-new-topic" /> 
  26.  
  27. <?php if ( current_user_can( 'unfiltered_html' ) ) 
  28. wp_nonce_field( 'bbp-unfiltered-html-topic_new', '_bbp_unfiltered_html_topic', false ); ?> 
  29.  
  30. <?php wp_nonce_field( 'bbp-new-topic' ); 
  31.  
  32. endif;