1<?php
2/**
3 * List Table API: WP_Post_Comments_List_Table class
4 *
5 * @package WordPress
6 * @subpackage Administration
7 * @since 4.4.0
8 */
9
10/**
11 * Core class used to implement displaying post comments in a list table.
12 *
13 * @since 3.1.0
14 *
15 * @see WP_Comments_List_Table
16 */
17class WP_Post_Comments_List_Table extends WP_Comments_List_Table {
18
19 /**
20 * @return array
21 */
22 protected function get_column_info() {
23 return array(
24 array(
25 'author' => __( 'Author' ),
26 'comment' => _x( 'Comment', 'column name' ),
27 ),
28 array(),
29 array(),
30 'comment',
31 );
32 }
33
34 /**
35 * @return array
36 */
37 protected function get_table_classes() {
38 $classes = parent::get_table_classes();
39 $classes[] = 'wp-list-table';
40 $classes[] = 'comments-box';
41 return $classes;
42 }
43
44 /**
45 * @param bool $output_empty
46 */
47 public function display( $output_empty = false ) {
48 $singular = $this->_args['singular'];
49
50 wp_nonce_field( 'fetch-list-' . get_class( $this ), '_ajax_fetch_list_nonce' );
51 ?>
52<table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" style="display:none;">
53 <tbody id="the-comment-list"
54 <?php
55 if ( $singular ) {
56 echo " data-wp-lists='list:$singular'";
57 }
58 ?>
59 >
60 <?php
61 if ( ! $output_empty ) {
62 $this->display_rows_or_placeholder();
63 }
64 ?>
65 </tbody>
66</table>
67 <?php
68 }
69
70 /**
71 * @param bool $comment_status
72 * @return int
73 */
74 public function get_per_page( $comment_status = false ) {
75 return 10;
76 }
77}
78