bbp_reply_metabox

Reply metabox.

Description

bbp_reply_metabox(); 

The metabox that holds all of the additional reply information


Usage

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

Defined (1)

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

/includes/admin/metaboxes.php  
  1. function bbp_reply_metabox() { 
  2.  
  3. // Post ID 
  4. $post_id = get_the_ID(); 
  5.  
  6. // Get some meta 
  7. $reply_topic_id = bbp_get_reply_topic_id( $post_id ); 
  8. $reply_forum_id = bbp_get_reply_forum_id( $post_id ); 
  9. $reply_to = bbp_get_reply_to( $post_id ); 
  10.  
  11. // Allow individual manipulation of reply forum 
  12. if ( current_user_can( 'edit_others_replies' ) || current_user_can( 'moderate' ) ) : ?> 
  13.  
  14. <p> 
  15. <strong class="label"><?php esc_html_e( 'Forum:', bbpress ); ?></strong> 
  16. <label class="screen-reader-text" for="bbp_forum_id"><?php esc_html_e( 'Forum', bbpress ); ?></label> 
  17. <?php bbp_dropdown( array( 
  18. 'post_type' => bbp_get_forum_post_type(),  
  19. 'selected' => $reply_forum_id,  
  20. 'numberposts' => -1,  
  21. 'orderby' => 'title',  
  22. 'order' => 'ASC',  
  23. walker => '',  
  24. 'exclude' => '',  
  25.  
  26. // Output-related 
  27. 'select_id' => 'bbp_forum_id',  
  28. 'tab' => bbp_get_tab_index(),  
  29. 'options_only' => false,  
  30. 'show_none' => __( '— No parent —', bbpress ),  
  31. 'disable_categories' => current_user_can( 'edit_forums' ),  
  32. 'disabled' => '' 
  33. ) ); ?> 
  34. </p> 
  35.  
  36. <?php endif; ?> 
  37.  
  38. <p> 
  39. <strong class="label"><?php esc_html_e( 'Topic:', bbpress ); ?></strong> 
  40. <label class="screen-reader-text" for="parent_id"><?php esc_html_e( 'Topic', bbpress ); ?></label> 
  41. <input name="parent_id" id="bbp_topic_id" type="text" value="<?php echo esc_attr( $reply_topic_id ); ?>" data-ajax-url="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_suggest_topic' ), admin_url( 'admin-ajax.php', 'relative' ) ) ), 'bbp_suggest_topic_nonce' ); ?>" /> 
  42. </p> 
  43.  
  44. <p> 
  45. <strong class="label"><?php esc_html_e( 'Reply To:', bbpress ); ?></strong> 
  46. <label class="screen-reader-text" for="bbp_reply_to"><?php esc_html_e( 'Reply To', bbpress ); ?></label> 
  47. <input name="bbp_reply_to" id="bbp_reply_to" type="text" value="<?php echo esc_attr( $reply_to ); ?>" /> 
  48. </p> 
  49.  
  50. <input name="ping_status" type="hidden" id="ping_status" value="open" /> 
  51.  
  52. <?php 
  53. wp_nonce_field( 'bbp_reply_metabox_save', 'bbp_reply_metabox' ); 
  54. do_action( 'bbp_reply_metabox', $post_id );