Site icon Hip-Hop Website Design and Development

Show all feedback publish not work in Edit remark web page

I’m making an attempt to indicate all feedback associated to the publish the remark being edited belongs to.

My code (based mostly on this instance)

add_action( 'admin_menu', 'all_display_comments_add_meta_box' );

operate all_display_comments_add_meta_box() {
    add_meta_box( 'commentsdiv', __( 'Feedback' ), 'my_post_comment_meta_box', 'remark', 'regular', 'excessive' );
}

operate my_post_comment_meta_box( $publish ) {

    $whole         = get_comments(
        array(
            'post_id' => $post->ID,
            'quantity'  => 1,
            'rely'   => true,
        )
    );
    $wp_list_table = _get_list_table( 'WP_Post_Comments_List_Table' );
    $wp_list_table->show( true );

    if ( 1 > $whole ) {
        echo '<p id="no-comments">' . __( 'No feedback but.' ) . '</p>';
    } else {
        $hidden = get_hidden_meta_boxes( get_current_screen() );
        if ( ! in_array( 'commentsdiv', $hidden, true ) ) {
            ?>
            <script sort="text/javascript">jQuery(doc).prepared(operate(){commentsBox.get(<?php echo $whole; ?>, 10);});</script>
            <?php
        }

        ?>
        <p class="hide-if-no-js" id="show-comments"><a href="#commentstatusdiv" onclick="commentsBox.load(<?php echo $total; ?>);return false;"><?php _e( 'Present feedback' ); ?></a> <span class="spinner"></span></p>
        <?php
    }

    wp_comment_trashnotice();
}


Sorry for my English.