mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-24 18:18:01 +01:00
56c162fbc9
WPCS 1.0.0 includes a bunch of new auto-fixers, which drops the number of coding standards issues across WordPress significantly. Prior to running the auto-fixers, there were 15,312 issues detected. With this commit, we now drop to 4,769 issues. This change includes three notable additions: - Multiline function calls must now put each parameter on a new line. - Auto-formatting files is now part of the `grunt precommit` script. - Auto-fixable coding standards issues will now cause Travis failures. Fixes #44600. Built from https://develop.svn.wordpress.org/trunk@43571 git-svn-id: http://core.svn.wordpress.org/trunk@43400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
79 lines
1.4 KiB
PHP
79 lines
1.4 KiB
PHP
<?php
|
|
/**
|
|
* List Table API: WP_Post_Comments_List_Table class
|
|
*
|
|
* @package WordPress
|
|
* @subpackage Administration
|
|
* @since 4.4.0
|
|
*/
|
|
|
|
/**
|
|
* Core class used to implement displaying post comments in a list table.
|
|
*
|
|
* @since 3.1.0
|
|
* @access private
|
|
*
|
|
* @see WP_Comments_List_Table
|
|
*/
|
|
class WP_Post_Comments_List_Table extends WP_Comments_List_Table {
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected function get_column_info() {
|
|
return array(
|
|
array(
|
|
'author' => __( 'Author' ),
|
|
'comment' => _x( 'Comment', 'column name' ),
|
|
),
|
|
array(),
|
|
array(),
|
|
'comment',
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected function get_table_classes() {
|
|
$classes = parent::get_table_classes();
|
|
$classes[] = 'wp-list-table';
|
|
$classes[] = 'comments-box';
|
|
return $classes;
|
|
}
|
|
|
|
/**
|
|
* @param bool $output_empty
|
|
*/
|
|
public function display( $output_empty = false ) {
|
|
$singular = $this->_args['singular'];
|
|
|
|
wp_nonce_field( 'fetch-list-' . get_class( $this ), '_ajax_fetch_list_nonce' );
|
|
?>
|
|
<table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" style="display:none;">
|
|
<tbody id="the-comment-list"
|
|
<?php
|
|
if ( $singular ) {
|
|
echo " data-wp-lists='list:$singular'";
|
|
}
|
|
?>
|
|
>
|
|
<?php
|
|
if ( ! $output_empty ) {
|
|
$this->display_rows_or_placeholder();
|
|
}
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
<?php
|
|
}
|
|
|
|
/**
|
|
* @param bool $comment_status
|
|
* @return int
|
|
*/
|
|
public function get_per_page( $comment_status = false ) {
|
|
return 10;
|
|
}
|
|
}
|