bbp_topic_metabox()

Topic metabox

Description

The metabox that holds all of the additional topic information

Source

File: bp-forums/admin/metaboxes.php

351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
function bbp_topic_metabox() {
 
    // Post ID
    $post_id = get_the_ID();
 
    /** Type ******************************************************************/
 
    ?>
 
    <p>
        <strong class="label"><?php esc_html_e( 'Type:', 'buddyboss' ); ?></strong>
        <label class="screen-reader-text" for="bbp_stick_topic"><?php esc_html_e( 'Type', 'buddyboss' ); ?></label>
        <?php bbp_form_topic_type_dropdown( array( 'topic_id' => $post_id ) ); ?>
    </p>
 
    <?php
 
    /** Status ****************************************************************/
 
    ?>
 
    <p>
        <strong class="label"><?php esc_html_e( 'Status:', 'buddyboss' ); ?></strong>
        <label class="screen-reader-text" for="bbp_open_close_topic"><?php esc_html_e( 'Select whether to open or close the discussion.', 'buddyboss' ); ?></label>
        <?php bbp_form_topic_status_dropdown( array( 'select_id' => 'post_status', 'topic_id' => $post_id ) ); ?>
    </p>
 
    <?php
 
    /** Parent *****************************************************************/
 
    ?>
 
    <p>
        <strong class="label"><?php esc_html_e( 'Forum:', 'buddyboss' ); ?></strong>
        <label class="screen-reader-text" for="parent_id"><?php esc_html_e( 'Forum', 'buddyboss' ); ?></label>
        <?php bbp_dropdown( array(
            'post_type'          => bbp_get_forum_post_type(),
            'selected'           => bbp_get_topic_forum_id( $post_id ),
            'numberposts'        => -1,
            'orderby'            => 'title',
            'order'              => 'ASC',
            'walker'             => '',
            'exclude'            => '',
 
            // Output-related
            'select_id'          => 'parent_id',
            'tab'                => bbp_get_tab_index(),
            'options_only'       => false,
            'show_none'          => __( '- Select Forum -', 'buddyboss' ),
            'disable_categories' => current_user_can( 'edit_forums' ),
            'disabled'           => ''
        ) ); ?>
    </p>
 
    <input name="ping_status" type="hidden" id="ping_status" value="open" />
 
    <?php
    wp_nonce_field( 'bbp_topic_metabox_save', 'bbp_topic_metabox' );
    do_action( 'bbp_topic_metabox', $post_id );
}

Changelog

Changelog
Version Description
bbPress (r2464) 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.