PageRenderTime 24ms CodeModel.GetById 15ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-admin/includes/class-wp-post-comments-list-table.php

https://bitbucket.org/devbctph/futura_wp
PHP | 77 lines | 39 code | 6 blank | 32 comment | 2 complexity | 5c34f85a05eee305eac2654e5d25e544 MD5 | raw file
 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 * @access private
15 *
16 * @see WP_Comments_List_Table
17 */
18class WP_Post_Comments_List_Table extends WP_Comments_List_Table {
19
20	/**
21	 *
22	 * @return array
23	 */
24	protected function get_column_info() {
25		return array(
26			array(
27				'author'   => __( 'Author' ),
28				'comment'  => _x( 'Comment', 'column name' ),
29			),
30			array(),
31			array(),
32			'comment',
33		);
34	}
35
36	/**
37	 *
38	 * @return array
39	 */
40	protected function get_table_classes() {
41		$classes = parent::get_table_classes();
42		$classes[] = 'wp-list-table';
43		$classes[] = 'comments-box';
44		return $classes;
45	}
46
47	/**
48	 *
49	 * @param bool $output_empty
50	 */
51	public function display( $output_empty = false ) {
52		$singular = $this->_args['singular'];
53
54		wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' );
55?>
56<table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" style="display:none;">
57	<tbody id="the-comment-list"<?php
58		if ( $singular ) {
59			echo " data-wp-lists='list:$singular'";
60		} ?>>
61		<?php if ( ! $output_empty ) {
62			$this->display_rows_or_placeholder();
63		} ?>
64	</tbody>
65</table>
66<?php
67	}
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}