/** * Forum metabox * * The metabox that holds all of the additional forum information * * @since 2.0.0 bbPress (r2744) * * @uses bbp_is_forum_closed() To check if a forum is closed or not * @uses bbp_is_forum_category() To check if a forum is a category or not * @uses bbp_is_forum_private() To check if a forum is private or not * @uses bbp_dropdown() To show a dropdown of the forums for forum parent * @uses do_action() Calls 'bbp_forum_metabox' */ function bbp_forum_metabox() { // Post ID $post_id = get_the_ID(); $post_parent = bbp_get_global_post_field('post_parent', 'raw'); $menu_order = bbp_get_global_post_field('menu_order', 'edit'); /** Type ******************************************************************/ ?> <p> <strong class="label"><?php esc_html_e('Type:', 'bbpress'); ?> </strong> <label class="screen-reader-text" for="bbp_forum_type_select"><?php esc_html_e('Type:', 'bbpress'); ?> </label> <?php bbp_form_forum_type_dropdown(array('forum_id' => $post_id)); ?> </p> <?php /** Status ****************************************************************/ ?> <p> <strong class="label"><?php esc_html_e('Status:', 'bbpress'); ?> </strong> <label class="screen-reader-text" for="bbp_forum_status_select"><?php esc_html_e('Status:', 'bbpress'); ?> </label> <?php bbp_form_forum_status_dropdown(array('forum_id' => $post_id)); ?> </p> <?php /** Visibility ************************************************************/ ?> <p> <strong class="label"><?php esc_html_e('Visibility:', 'bbpress'); ?> </strong> <label class="screen-reader-text" for="bbp_forum_visibility_select"><?php esc_html_e('Visibility:', 'bbpress'); ?> </label> <?php bbp_form_forum_visibility_dropdown(array('forum_id' => $post_id)); ?> </p> <hr /> <?php /** Parent ****************************************************************/ ?> <p> <strong class="label"><?php esc_html_e('Parent:', 'bbpress'); ?> </strong> <label class="screen-reader-text" for="parent_id"><?php esc_html_e('Forum Parent', 'bbpress'); ?> </label> <?php bbp_dropdown(array('post_type' => bbp_get_forum_post_type(), 'selected' => $post_parent, 'numberposts' => -1, 'orderby' => 'title', 'order' => 'ASC', 'walker' => '', 'exclude' => $post_id, 'select_id' => 'parent_id', 'options_only' => false, 'show_none' => __('— No forum —', 'bbpress'), 'disable_categories' => false, 'disabled' => '')); ?> </p> <p> <strong class="label"><?php esc_html_e('Order:', 'bbpress'); ?> </strong> <label class="screen-reader-text" for="menu_order"><?php esc_html_e('Forum Order', 'bbpress'); ?> </label> <input name="menu_order" type="number" step="1" size="4" id="menu_order" value="<?php echo esc_attr($menu_order); ?> " /> </p> <input name="ping_status" type="hidden" id="ping_status" value="open" /> <?php wp_nonce_field('bbp_forum_metabox_save', 'bbp_forum_metabox'); do_action('bbp_forum_metabox', $post_id); }
<?php } ?> <?php do_action('bbp_theme_before_forum_form_type'); ?> <p> <label for="bbp_forum_type"><?php _e('Forum Type:', 'bbpress'); ?> </label><br /> <?php bbp_form_forum_type_dropdown(); ?> </p> <?php do_action('bbp_theme_after_forum_form_type'); ?> <?php do_action('bbp_theme_before_forum_form_status'); ?> <p> <label for="bbp_forum_status"><?php _e('Status:', 'bbpress'); ?>
/** * Forum metabox * * The metabox that holds all of the additional forum information * * @since bbPress (r2744) * * @uses bbp_is_forum_closed() To check if a forum is closed or not * @uses bbp_is_forum_category() To check if a forum is a category or not * @uses bbp_is_forum_private() To check if a forum is private or not * @uses bbp_dropdown() To show a dropdown of the forums for forum parent * @uses do_action() Calls 'bbp_forum_metabox' */ function bbp_forum_metabox() { // Post ID $post_id = get_the_ID(); $post_parent = bbp_get_global_post_field('post_parent', 'raw'); $menu_order = bbp_get_global_post_field('menu_order', 'edit'); /** Type ******************************************************************/ ?> <p> <strong class="label"><?php _e('Type:', 'bbpress'); ?> </strong> <label class="screen-reader-text" for="bbp_forum_type_select"><?php _e('Type:', 'bbpress'); ?> </label> <?php bbp_form_forum_type_dropdown($post_id); ?> </p> <?php /** Status ****************************************************************/ ?> <p> <strong class="label"><?php _e('Status:', 'bbpress'); ?> </strong> <label class="screen-reader-text" for="bbp_forum_status_select"><?php _e('Status:', 'bbpress'); ?> </label> <?php bbp_form_forum_status_dropdown($post_id); ?> </p> <?php /** Visibility ************************************************************/ ?> <p> <strong class="label"><?php _e('Visibility:', 'bbpress'); ?> </strong> <label class="screen-reader-text" for="bbp_forum_visibility_select"><?php _e('Visibility:', 'bbpress'); ?> </label> <?php bbp_form_forum_visibility_dropdown($post_id); ?> </p> <hr /> <?php /** Parent ****************************************************************/ ?> <p> <strong class="label"><?php _e('Parent:', 'bbpress'); ?> </strong> <label class="screen-reader-text" for="parent_id"><?php _e('Forum Parent', 'bbpress'); ?> </label> <?php bbp_dropdown(array('exclude' => $post_id, 'selected' => $post_parent, 'show_none' => __('(No Parent)', 'bbpress'), 'select_id' => 'parent_id', 'disable_categories' => false)); ?> </p> <p> <strong class="label"><?php _e('Order:', 'bbpress'); ?> </strong> <label class="screen-reader-text" for="menu_order"><?php _e('Forum Order', 'bbpress'); ?> </label> <input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo $menu_order; ?> " /> </p> <?php wp_nonce_field('bbp_forum_metabox_save', 'bbp_forum_metabox'); do_action('bbp_forum_metabox', $post_id); }