Move WP_Post_Comments_List_Table
to its own file.
See #33413. git-svn-id: https://develop.svn.wordpress.org/trunk@34223 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
7e706c285b
commit
05cd237d5e
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* Comments and Post Comments List Table classes.
|
||||
* Comments List Table class.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage List_Table
|
||||
@ -735,74 +735,3 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
do_action( 'manage_comments_custom_column', $column_name, $comment->comment_ID );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Post Comments List Table class.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage List_Table
|
||||
* @since 3.1.0
|
||||
* @access private
|
||||
*
|
||||
* @see WP_Comments_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;
|
||||
}
|
||||
}
|
||||
|
79
src/wp-admin/includes/class-wp-post-comments-list-table.php
Normal file
79
src/wp-admin/includes/class-wp-post-comments-list-table.php
Normal file
@ -0,0 +1,79 @@
|
||||
<?php
|
||||
/**
|
||||
* Post Comments List Table class
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage List_Table
|
||||
* @since 4.4.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Post Comments List Table class.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage List_Table
|
||||
* @since 3.1.0
|
||||
* @access private
|
||||
*
|
||||
* @see WP_Comments_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;
|
||||
}
|
||||
}
|
@ -27,7 +27,7 @@ function _get_list_table( $class, $args = array() ) {
|
||||
'WP_Terms_List_Table' => 'terms',
|
||||
'WP_Users_List_Table' => 'users',
|
||||
'WP_Comments_List_Table' => 'comments',
|
||||
'WP_Post_Comments_List_Table' => 'comments',
|
||||
'WP_Post_Comments_List_Table' => 'post-comments',
|
||||
'WP_Links_List_Table' => 'links',
|
||||
'WP_Plugin_Install_List_Table' => 'plugin-install',
|
||||
'WP_Themes_List_Table' => 'themes',
|
||||
|
Loading…
Reference in New Issue
Block a user