2015-09-16 02:53:24 -04:00
|
|
|
<?php
|
|
|
|
/**
|
2015-10-17 11:13:25 -04:00
|
|
|
* List Table API: WP_Post_Comments_List_Table class
|
2015-09-16 02:53:24 -04:00
|
|
|
*
|
|
|
|
* @package WordPress
|
2015-10-17 11:13:25 -04:00
|
|
|
* @subpackage Administration
|
2015-09-16 02:53:24 -04:00
|
|
|
* @since 4.4.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2015-10-17 11:13:25 -04:00
|
|
|
* Core class used to implement displaying post comments in a list table.
|
2015-09-16 02:53:24 -04:00
|
|
|
*
|
|
|
|
* @since 3.1.0
|
|
|
|
* @access private
|
|
|
|
*
|
2015-09-22 10:31:24 -04:00
|
|
|
* @see WP_Comments_List_Table
|
2015-09-16 02:53:24 -04:00
|
|
|
*/
|
|
|
|
class WP_Post_Comments_List_Table extends WP_Comments_List_Table {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function get_column_info() {
|
|
|
|
return array(
|
|
|
|
array(
|
2017-11-30 18:11:00 -05:00
|
|
|
'author' => __( 'Author' ),
|
|
|
|
'comment' => _x( 'Comment', 'column name' ),
|
2015-09-16 02:53:24 -04:00
|
|
|
),
|
|
|
|
array(),
|
|
|
|
array(),
|
|
|
|
'comment',
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function get_table_classes() {
|
2017-11-30 18:11:00 -05:00
|
|
|
$classes = parent::get_table_classes();
|
2015-09-16 02:53:24 -04:00
|
|
|
$classes[] = 'wp-list-table';
|
|
|
|
$classes[] = 'comments-box';
|
|
|
|
return $classes;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param bool $output_empty
|
|
|
|
*/
|
|
|
|
public function display( $output_empty = false ) {
|
|
|
|
$singular = $this->_args['singular'];
|
|
|
|
|
2017-11-30 18:11:00 -05:00
|
|
|
wp_nonce_field( 'fetch-list-' . get_class( $this ), '_ajax_fetch_list_nonce' );
|
2015-09-16 02:53:24 -04:00
|
|
|
?>
|
|
|
|
<table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" style="display:none;">
|
2017-11-30 18:11:00 -05:00
|
|
|
<tbody id="the-comment-list"
|
|
|
|
<?php
|
|
|
|
if ( $singular ) {
|
|
|
|
echo " data-wp-lists='list:$singular'";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
>
|
|
|
|
<?php
|
|
|
|
if ( ! $output_empty ) {
|
2015-09-16 02:53:24 -04:00
|
|
|
$this->display_rows_or_placeholder();
|
2017-11-30 18:11:00 -05:00
|
|
|
}
|
|
|
|
?>
|
2015-09-16 02:53:24 -04:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param bool $comment_status
|
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function get_per_page( $comment_status = false ) {
|
|
|
|
return 10;
|
|
|
|
}
|
|
|
|
}
|