bbp_topic_metabox

Topic metabox.

Description

bbp_topic_metabox(); 

The metabox that holds all of the additional topic information


Usage

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

Defined (1)

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

/includes/admin/metaboxes.php  
  1. function bbp_topic_metabox() { 
  2.  
  3. // Post ID 
  4. $post_id = get_the_ID(); 
  5.  
  6. /** Type ******************************************************************/ 
  7.  
  8. ?> 
  9.  
  10. <p> 
  11. <strong class="label"><?php esc_html_e( 'Type:', bbpress ); ?></strong> 
  12. <label class="screen-reader-text" for="bbp_stick_topic"><?php esc_html_e( 'Topic Type', bbpress ); ?></label> 
  13. <?php bbp_form_topic_type_dropdown( array( 'topic_id' => $post_id ) ); ?> 
  14. </p> 
  15.  
  16. <?php 
  17.  
  18. /** Status ****************************************************************/ 
  19.  
  20. ?> 
  21.  
  22. <p> 
  23. <strong class="label"><?php esc_html_e( 'Status:', bbpress ); ?></strong> 
  24. <label class="screen-reader-text" for="bbp_open_close_topic"><?php esc_html_e( 'Select whether to open or close the topic.', bbpress ); ?></label> 
  25. <?php bbp_form_topic_status_dropdown( array( 'select_id' => 'post_status', 'topic_id' => $post_id ) ); ?> 
  26. </p> 
  27.  
  28. <?php 
  29.  
  30. /** Parent *****************************************************************/ 
  31.  
  32. ?> 
  33.  
  34. <p> 
  35. <strong class="label"><?php esc_html_e( 'Forum:', bbpress ); ?></strong> 
  36. <label class="screen-reader-text" for="parent_id"><?php esc_html_e( 'Forum', bbpress ); ?></label> 
  37. <?php bbp_dropdown( array( 
  38. 'post_type' => bbp_get_forum_post_type(),  
  39. 'selected' => bbp_get_topic_forum_id( $post_id ),  
  40. 'numberposts' => -1,  
  41. 'orderby' => 'title',  
  42. 'order' => 'ASC',  
  43. walker => '',  
  44. 'exclude' => '',  
  45.  
  46. // Output-related 
  47. 'select_id' => 'parent_id',  
  48. 'tab' => bbp_get_tab_index(),  
  49. 'options_only' => false,  
  50. 'show_none' => __( '— No parent —', bbpress ),  
  51. 'disable_categories' => current_user_can( 'edit_forums' ),  
  52. 'disabled' => '' 
  53. ) ); ?> 
  54. </p> 
  55.  
  56. <input name="ping_status" type="hidden" id="ping_status" value="open" /> 
  57.  
  58. <?php 
  59. wp_nonce_field( 'bbp_topic_metabox_save', 'bbp_topic_metabox' ); 
  60. do_action( 'bbp_topic_metabox', $post_id );