Administration: Backwards compatibility for new sortable keys.

Replace use of `list` to parse array keys into variables. `list` throws errors if the keys don't exist, and many extenders will not define the new array keys. The code path already falls back effectively for empty values.

Also add translator comments to screen reader hidden text, fix a docblock, and fix an HTML error.

Follow up to [r55971].

Props kebbet, chouby, joedolson.
Fixes #32170.

git-svn-id: https://develop.svn.wordpress.org/trunk@56004 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Joe Dolson
2023-06-23 17:47:34 +00:00
parent 85e6518189
commit 15a9bcad35
2 changed files with 28 additions and 10 deletions
@@ -583,7 +583,10 @@ class WP_Comments_List_Table extends WP_List_Table {
<?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">' . __( 'Ordered by Comment Date, descending.' ) . '</p>';
echo '<caption class="screen-reader-text">' .
/* translators: Hidden accessibility text. */
__( 'Ordered by Comment Date, descending.' ) .
'</caption>';
} else {
$this->print_table_description();
}