+if ( isset($_REQUEST['approved']) || isset($_REQUEST['deleted']) || isset($_REQUEST['trashed']) || isset($_REQUEST['untrashed']) || isset($_REQUEST['spammed']) || isset($_REQUEST['unspammed']) || isset($_REQUEST['same']) ) {
+ $approved = isset( $_REQUEST['approved'] ) ? (int) $_REQUEST['approved'] : 0;
+ $deleted = isset( $_REQUEST['deleted'] ) ? (int) $_REQUEST['deleted'] : 0;
+ $trashed = isset( $_REQUEST['trashed'] ) ? (int) $_REQUEST['trashed'] : 0;
+ $untrashed = isset( $_REQUEST['untrashed'] ) ? (int) $_REQUEST['untrashed'] : 0;
+ $spammed = isset( $_REQUEST['spammed'] ) ? (int) $_REQUEST['spammed'] : 0;
+ $unspammed = isset( $_REQUEST['unspammed'] ) ? (int) $_REQUEST['unspammed'] : 0;
+ $same = isset( $_REQUEST['same'] ) ? (int) $_REQUEST['same'] : 0;
+
+ if ( $approved > 0 || $deleted > 0 || $trashed > 0 || $untrashed > 0 || $spammed > 0 || $unspammed > 0 || $same > 0 ) {
+ if ( $approved > 0 ) {
+ /* translators: %s: number of comments approved */
+ $messages[] = sprintf( _n( '%s comment approved', '%s comments approved', $approved ), $approved );
+ }
+
+ if ( $spammed > 0 ) {
+ $ids = isset($_REQUEST['ids']) ? $_REQUEST['ids'] : 0;
+ /* translators: %s: number of comments marked as spam */
+ $messages[] = sprintf( _n( '%s comment marked as spam.', '%s comments marked as spam.', $spammed ), $spammed ) . ' <a href="' . esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=unspam&ids=$ids", "bulk-comments" ) ) . '">' . __('Undo') . '</a><br />';
+ }
+
+ if ( $unspammed > 0 ) {
+ /* translators: %s: number of comments restored from the spam */
+ $messages[] = sprintf( _n( '%s comment restored from the spam', '%s comments restored from the spam', $unspammed ), $unspammed );
+ }
+
+ if ( $trashed > 0 ) {
+ $ids = isset($_REQUEST['ids']) ? $_REQUEST['ids'] : 0;
+ /* translators: %s: number of comments moved to the Trash */
+ $messages[] = sprintf( _n( '%s comment moved to the Trash.', '%s comments moved to the Trash.', $trashed ), $trashed ) . ' <a href="' . esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=untrash&ids=$ids", "bulk-comments" ) ) . '">' . __('Undo') . '</a><br />';
+ }
+
+ if ( $untrashed > 0 ) {
+ /* translators: %s: number of comments restored from the Trash */
+ $messages[] = sprintf( _n( '%s comment restored from the Trash', '%s comments restored from the Trash', $untrashed ), $untrashed );
+ }
+
+ if ( $deleted > 0 ) {
+ /* translators: %s: number of comments permanently deleted */
+ $messages[] = sprintf( _n( '%s comment permanently deleted', '%s comments permanently deleted', $deleted ), $deleted );
+ }
+
+ if ( $same > 0 && $comment = get_comment( $same ) ) {
+ switch ( $comment->comment_approved ) {
+ case '1' :
+ $messages[] = __('This comment is already approved.') . ' <a href="' . esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ) . '">' . __( 'Edit comment' ) . '</a>';
+ break;
+ case 'trash' :
+ $messages[] = __( 'This comment is already in the Trash.' ) . ' <a href="' . esc_url( admin_url( 'edit-comments.php?comment_status=trash' ) ) . '"> ' . __( 'View Trash' ) . '</a>';
+ break;
+ case 'spam' :
+ $messages[] = __( 'This comment is already marked as spam.' ) . ' <a href="' . esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ) . '">' . __( 'Edit comment' ) . '</a>';
+ break;
+ }
+ }
+
+ echo '<div id="moderated" class="updated notice is-dismissible"><p>' . implode( "<br/>\n", $messages ) . '</p></div>';
+ }
+}
+?>
+
+<?php $wp_list_table->views(); ?>
+
+<form id="comments-form" method="get">
+
+<?php $wp_list_table->search_box( __( 'Search Comments' ), 'comment' ); ?>
+
+<?php if ( $post_id ) : ?>
+<input type="hidden" name="p" value="<?php echo esc_attr( intval( $post_id ) ); ?>" />
+<?php endif; ?>
+<input type="hidden" name="comment_status" value="<?php echo esc_attr($comment_status); ?>" />
+<input type="hidden" name="pagegen_timestamp" value="<?php echo esc_attr(current_time('mysql', 1)); ?>" />
+
+<input type="hidden" name="_total" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg('total_items') ); ?>" />
+<input type="hidden" name="_per_page" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg('per_page') ); ?>" />
+<input type="hidden" name="_page" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg('page') ); ?>" />
+
+<?php if ( isset($_REQUEST['paged']) ) { ?>
+ <input type="hidden" name="paged" value="<?php echo esc_attr( absint( $_REQUEST['paged'] ) ); ?>" />
+<?php } ?>
+
+<?php $wp_list_table->display(); ?>
+</form>