bbp_forum_metabox()

Forum metabox

Description

The metabox that holds all of the additional forum information

Source

File: bp-forums/admin/metaboxes.php

251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
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:', 'buddyboss' ); ?></strong>
        <label class="screen-reader-text" for="bbp_forum_type_select"><?php esc_html_e( 'Type:', 'buddyboss' ) ?></label>
        <?php bbp_form_forum_type_dropdown( array( 'forum_id' => $post_id ) ); ?>
    </p>
 
    <?php
 
    /** Status ****************************************************************/
 
    ?>
 
    <p>
        <strong class="label"><?php esc_html_e( 'Status:', 'buddyboss' ); ?></strong>
        <label class="screen-reader-text" for="bbp_forum_status_select"><?php esc_html_e( 'Status:', 'buddyboss' ) ?></label>
        <?php bbp_form_forum_status_dropdown( array( 'forum_id' => $post_id ) ); ?>
    </p>
 
    <?php
 
    /** Visibility ************************************************************/
 
    ?>
 
    <p>
        <strong class="label"><?php esc_html_e( 'Visibility:', 'buddyboss' ); ?></strong>
        <label class="screen-reader-text" for="bbp_forum_visibility_select"><?php esc_html_e( 'Visibility:', 'buddyboss' ) ?></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:', 'buddyboss' ); ?></strong>
        <label class="screen-reader-text" for="parent_id"><?php esc_html_e( 'Forum Parent', 'buddyboss' ); ?></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,
 
            // Output-related
            'select_id'          => 'parent_id',
            'tab'                => bbp_get_tab_index(),
            'options_only'       => false,
            'show_none'          => __( '- Select Forum -', 'buddyboss' ),
            'disable_categories' => false,
            'disabled'           => ''
        ) ); ?>
    </p>
 
    <p>
        <strong class="label"><?php esc_html_e( 'Order:', 'buddyboss' ); ?></strong>
        <label class="screen-reader-text" for="menu_order"><?php esc_html_e( 'Forum Order', 'buddyboss' ); ?></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 );
}

Changelog

Changelog
Version Description
bbPress (r2744) Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.