bbp_forum_form_fields

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

Description

bbp_forum_form_fields(); 

Usage

  1. if ( !function_exists( 'bbp_forum_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_forum_form_fields(); 
  7.  

Defined (1)

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

/includes/common/template.php  
  1. function bbp_forum_form_fields() { 
  2.  
  3. if ( bbp_is_forum_edit() ) : ?> 
  4.  
  5. <input type="hidden" name="action" id="bbp_post_action" value="bbp-edit-forum" /> 
  6. <input type="hidden" name="bbp_forum_id" id="bbp_forum_id" value="<?php bbp_forum_id(); ?>" /> 
  7.  
  8. <?php 
  9.  
  10. if ( current_user_can( 'unfiltered_html' ) ) 
  11. wp_nonce_field( 'bbp-unfiltered-html-forum_' . bbp_get_forum_id(), '_bbp_unfiltered_html_forum', false ); 
  12.  
  13. ?> 
  14.  
  15. <?php wp_nonce_field( 'bbp-edit-forum_' . bbp_get_forum_id() ); 
  16.  
  17. else : 
  18.  
  19. if ( bbp_is_single_forum() ) : ?> 
  20.  
  21. <input type="hidden" name="bbp_forum_parent_id" id="bbp_forum_parent_id" value="<?php bbp_forum_parent_id(); ?>" /> 
  22.  
  23. <?php endif; ?> 
  24.  
  25. <input type="hidden" name="action" id="bbp_post_action" value="bbp-new-forum" /> 
  26.  
  27. <?php 
  28.  
  29. if ( current_user_can( 'unfiltered_html' ) ) 
  30. wp_nonce_field( 'bbp-unfiltered-html-forum_new', '_bbp_unfiltered_html_forum', false ); 
  31.  
  32. ?> 
  33.  
  34. <?php wp_nonce_field( 'bbp-new-forum' ); 
  35.  
  36. endif;