bbp_reply_metabox()

Reply metabox

Description

The metabox that holds all of the additional reply information

Source

File: bp-forums/admin/metaboxes.php

436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
function bbp_reply_metabox() {
 
    // Post ID
    $post_id = get_the_ID();
 
    // Get some meta
    $reply_topic_id = bbp_get_reply_topic_id( $post_id );
    $reply_forum_id = bbp_get_reply_forum_id( $post_id );
    $reply_to       = bbp_get_reply_to(       $post_id );
 
    // Allow individual manipulation of reply forum
    if ( current_user_can( 'edit_others_replies' ) || current_user_can( 'moderate' ) ) : ?>
 
        <p>
            <strong class="label"><?php esc_html_e( 'Forum:', 'buddyboss' ); ?></strong>
            <label class="screen-reader-text" for="bbp_forum_id"><?php esc_html_e( 'Forum', 'buddyboss' ); ?></label>
            <?php bbp_dropdown( array(
                'post_type'             => bbp_get_forum_post_type(),
                'selected'              => $reply_forum_id,
                'numberposts'           => - 1,
                'orderby'               => 'title',
                'order'                 => 'ASC',
                'walker'                => '',
                'exclude'               => '',
 
                // Output-related
                'select_id'             => 'bbp_forum_id',
                'tab'                   => bbp_get_tab_index(),
                'options_only'          => false,
                'show_none'             => __( '- Select Forum -', 'buddyboss' ),
                'disable_categories'    => current_user_can( 'edit_forums' ),
                'disabled'              => '',
            ) ); ?>
        </p>
 
    <?php endif; ?>
 
    <p>
        <strong class="label"><?php esc_html_e( 'Discussion:', 'buddyboss' ); ?></strong>
        <label class="screen-reader-text" for="parent_id"><?php esc_html_e( 'Discussion', 'buddyboss' ); ?></label>
        <?php
        bbp_dropdown( array(
            'post_type'             => bbp_get_topic_post_type(),
            'selected'              => $reply_topic_id,
            'post_parent'           => $reply_forum_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 Discussion -', 'buddyboss' ),
            'show_none_default_val' => 0,
            'disable_categories'    => current_user_can( 'edit_forums' ),
            'disabled'              => '',
        ) );
        ?>
<!--     <input name="parent_id" id="bbp_topic_id" type="text" value="--><?php //echo esc_attr( $reply_topic_id ); ?><!--" data-ajax-url="--><?php //echo esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_suggest_topic' ), admin_url( 'admin-ajax.php', 'relative' ) ) ), 'bbp_suggest_topic_nonce' ); ?><!--" />-->
    </p>
 
    <p>
        <strong class="label"><?php esc_html_e( 'Reply To:', 'buddyboss' ); ?></strong>
        <label class="screen-reader-text" for="bbp_reply_to"><?php esc_html_e( 'Reply To', 'buddyboss' ); ?></label>
        <?php
        bbp_dropdown( array(
            'post_type'             => bbp_get_reply_post_type(),
            'selected'              => $reply_to,
            'post_parent'           => $reply_topic_id,
            'numberposts'           => - 1,
            'orderby'               => 'title',
            'order'                 => 'ASC',
            'walker'                => '',
            'exclude'               => '',
 
            // Output-related
            'select_id'             => 'bbp_reply_to',
            'tab'                   => bbp_get_tab_index(),
            'options_only'          => false,
            'show_none'             => __( '- Select Reply -', 'buddyboss' ),
            'show_none_default_val' => 0,
            'disable_categories'    => current_user_can( 'edit_forums' ),
            'disabled'              => '',
        ) );
        ?>
<!--     <input name="bbp_reply_to" id="bbp_reply_to" type="text" value="--><?php //echo esc_attr( $reply_to ); ?><!--" />-->
    </p>
 
    <input name="ping_status" type="hidden" id="ping_status" value="open" />
 
    <?php
    wp_nonce_field( 'bbp_reply_metabox_save', 'bbp_reply_metabox' );
    do_action( 'bbp_reply_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.