bbp_reply_form_fields

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

Description

bbp_reply_form_fields(); 

Usage

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

Defined (1)

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

/includes/common/template.php  
  1. function bbp_reply_form_fields() { 
  2.  
  3. if ( bbp_is_reply_edit() ) : ?> 
  4.  
  5. <input type="hidden" name="bbp_reply_id" id="bbp_reply_id" value="<?php bbp_reply_id(); ?>" /> 
  6. <input type="hidden" name="bbp_reply_to" id="bbp_reply_to" value="<?php bbp_form_reply_to(); ?>" /> 
  7. <input type="hidden" name="action" id="bbp_post_action" value="bbp-edit-reply" /> 
  8.  
  9. <?php if ( current_user_can( 'unfiltered_html' ) ) 
  10. wp_nonce_field( 'bbp-unfiltered-html-reply_' . bbp_get_reply_id(), '_bbp_unfiltered_html_reply', false ); ?> 
  11.  
  12. <?php wp_nonce_field( 'bbp-edit-reply_' . bbp_get_reply_id() ); 
  13.  
  14. else : ?> 
  15.  
  16. <input type="hidden" name="bbp_topic_id" id="bbp_topic_id" value="<?php bbp_topic_id(); ?>" /> 
  17. <input type="hidden" name="bbp_reply_to" id="bbp_reply_to" value="<?php bbp_form_reply_to(); ?>" /> 
  18. <input type="hidden" name="action" id="bbp_post_action" value="bbp-new-reply" /> 
  19.  
  20. <?php if ( current_user_can( 'unfiltered_html' ) ) 
  21. wp_nonce_field( 'bbp-unfiltered-html-reply_' . bbp_get_topic_id(), '_bbp_unfiltered_html_reply', false ); ?> 
  22.  
  23. <?php wp_nonce_field( 'bbp-new-reply' ); 
  24.  
  25. // Show redirect field if not viewing a specific topic 
  26. if ( bbp_is_query_name( 'bbp_single_topic' ) ) : 
  27. bbp_redirect_to_field( get_permalink() ); 
  28.  
  29. endif; 
  30. endif;