rebase on oct-10-2023
This commit is contained in:
@@ -140,16 +140,17 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
);
|
||||
|
||||
$args = array(
|
||||
'status' => isset( $status_map[ $comment_status ] ) ? $status_map[ $comment_status ] : $comment_status,
|
||||
'search' => $search,
|
||||
'user_id' => $user_id,
|
||||
'offset' => $start,
|
||||
'number' => $number,
|
||||
'post_id' => $post_id,
|
||||
'type' => $comment_type,
|
||||
'orderby' => $orderby,
|
||||
'order' => $order,
|
||||
'post_type' => $post_type,
|
||||
'status' => isset( $status_map[ $comment_status ] ) ? $status_map[ $comment_status ] : $comment_status,
|
||||
'search' => $search,
|
||||
'user_id' => $user_id,
|
||||
'offset' => $start,
|
||||
'number' => $number,
|
||||
'post_id' => $post_id,
|
||||
'type' => $comment_type,
|
||||
'orderby' => $orderby,
|
||||
'order' => $order,
|
||||
'post_type' => $post_type,
|
||||
'update_comment_post_cache' => true,
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -164,8 +165,6 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
$_comments = get_comments( $args );
|
||||
|
||||
if ( is_array( $_comments ) ) {
|
||||
update_comment_cache( $_comments );
|
||||
|
||||
$this->items = array_slice( $_comments, 0, $comments_per_page );
|
||||
$this->extra_items = array_slice( $_comments, $comments_per_page );
|
||||
|
||||
@@ -457,7 +456,7 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
/**
|
||||
* @global int $post_id
|
||||
*
|
||||
* @return array
|
||||
* @return string[] Array of column titles keyed by their column name.
|
||||
*/
|
||||
public function get_columns() {
|
||||
global $post_id;
|
||||
@@ -541,8 +540,8 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
*/
|
||||
protected function get_sortable_columns() {
|
||||
return array(
|
||||
'author' => 'comment_author',
|
||||
'response' => 'comment_post_ID',
|
||||
'author' => array( 'comment_author', false, __( 'Author' ), __( 'Table ordered by Comment Author.' ) ),
|
||||
'response' => array( 'comment_post_ID', false, _x( 'In Response To', 'column name' ), __( 'Table ordered by Post Replied To.' ) ),
|
||||
'date' => 'comment_date',
|
||||
);
|
||||
}
|
||||
@@ -581,6 +580,17 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
|
||||
?>
|
||||
<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
|
||||
<?php
|
||||
if ( ! isset( $_GET['orderby'] ) ) {
|
||||
// In the initial view, Comments are ordered by comment's date but there's no column for that.
|
||||
echo '<caption class="screen-reader-text">' .
|
||||
/* translators: Hidden accessibility text. */
|
||||
__( 'Ordered by Comment Date, descending.' ) .
|
||||
'</caption>';
|
||||
} else {
|
||||
$this->print_table_description();
|
||||
}
|
||||
?>
|
||||
<thead>
|
||||
<tr>
|
||||
<?php $this->print_column_headers(); ?>
|
||||
@@ -885,11 +895,13 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
|
||||
if ( $this->user_can ) {
|
||||
?>
|
||||
<label class="screen-reader-text" for="cb-select-<?php echo $comment->comment_ID; ?>">
|
||||
<label class="label-covers-full-cell" for="cb-select-<?php echo $comment->comment_ID; ?>">
|
||||
<span class="screen-reader-text">
|
||||
<?php
|
||||
/* translators: Hidden accessibility text. */
|
||||
_e( 'Select comment' );
|
||||
?>
|
||||
</span>
|
||||
</label>
|
||||
<input id="cb-select-<?php echo $comment->comment_ID; ?>" type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" />
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user