bbp_forum_metabox

Forum metabox.

Description

bbp_forum_metabox(); 

The metabox that holds all of the additional forum information


Usage

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

Defined (1)

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

/includes/admin/metaboxes.php  
  1. function bbp_forum_metabox() { 
  2.  
  3. // Post ID 
  4. $post_id = get_the_ID(); 
  5. $post_parent = bbp_get_global_post_field( 'post_parent', 'raw' ); 
  6. $menu_order = bbp_get_global_post_field( 'menu_order', 'edit' ); 
  7.  
  8. /** Type ******************************************************************/ 
  9.  
  10. ?> 
  11.  
  12. <p> 
  13. <strong class="label"><?php esc_html_e( 'Type:', bbpress ); ?></strong> 
  14. <label class="screen-reader-text" for="bbp_forum_type_select"><?php esc_html_e( 'Type:', bbpress ) ?></label> 
  15. <?php bbp_form_forum_type_dropdown( array( 'forum_id' => $post_id ) ); ?> 
  16. </p> 
  17.  
  18. <?php 
  19.  
  20. /** Status ****************************************************************/ 
  21.  
  22. ?> 
  23.  
  24. <p> 
  25. <strong class="label"><?php esc_html_e( 'Status:', bbpress ); ?></strong> 
  26. <label class="screen-reader-text" for="bbp_forum_status_select"><?php esc_html_e( 'Status:', bbpress ) ?></label> 
  27. <?php bbp_form_forum_status_dropdown( array( 'forum_id' => $post_id ) ); ?> 
  28. </p> 
  29.  
  30. <?php 
  31.  
  32. /** Visibility ************************************************************/ 
  33.  
  34. ?> 
  35.  
  36. <p> 
  37. <strong class="label"><?php esc_html_e( 'Visibility:', bbpress ); ?></strong> 
  38. <label class="screen-reader-text" for="bbp_forum_visibility_select"><?php esc_html_e( 'Visibility:', bbpress ) ?></label> 
  39. <?php bbp_form_forum_visibility_dropdown( array( 'forum_id' => $post_id ) ); ?> 
  40. </p> 
  41.  
  42. <hr /> 
  43.  
  44. <?php 
  45.  
  46. /** Parent ****************************************************************/ 
  47.  
  48. ?> 
  49.  
  50. <p> 
  51. <strong class="label"><?php esc_html_e( 'Parent:', bbpress ); ?></strong> 
  52. <label class="screen-reader-text" for="parent_id"><?php esc_html_e( 'Forum Parent', bbpress ); ?></label> 
  53. <?php bbp_dropdown( array( 
  54. 'post_type' => bbp_get_forum_post_type(),  
  55. 'selected' => $post_parent,  
  56. 'numberposts' => -1,  
  57. 'orderby' => 'title',  
  58. 'order' => 'ASC',  
  59. walker => '',  
  60. 'exclude' => $post_id,  
  61.  
  62. // Output-related 
  63. 'select_id' => 'parent_id',  
  64. 'tab' => bbp_get_tab_index(),  
  65. 'options_only' => false,  
  66. 'show_none' => __( '— No parent —', bbpress ),  
  67. 'disable_categories' => false,  
  68. 'disabled' => '' 
  69. ) ); ?> 
  70. </p> 
  71.  
  72. <p> 
  73. <strong class="label"><?php esc_html_e( 'Order:', bbpress ); ?></strong> 
  74. <label class="screen-reader-text" for="menu_order"><?php esc_html_e( 'Forum Order', bbpress ); ?></label> 
  75. <input name="menu_order" type="number" step="1" size="4" id="menu_order" value="<?php echo esc_attr( $menu_order ); ?>" /> 
  76. </p> 
  77.  
  78. <input name="ping_status" type="hidden" id="ping_status" value="open" /> 
  79.  
  80. <?php 
  81. wp_nonce_field( 'bbp_forum_metabox_save', 'bbp_forum_metabox' ); 
  82. do_action( 'bbp_forum_metabox', $post_id );