diff --git a/src/wp-admin/includes/class-wp-comments-list-table.php b/src/wp-admin/includes/class-wp-comments-list-table.php index 49c3dc16ff..7d87ae9aab 100644 --- a/src/wp-admin/includes/class-wp-comments-list-table.php +++ b/src/wp-admin/includes/class-wp-comments-list-table.php @@ -583,7 +583,10 @@ class WP_Comments_List_Table extends WP_List_Table { ' . __( 'Ordered by Comment Date, descending.' ) . '

'; + echo '' . + /* translators: Hidden accessibility text. */ + __( 'Ordered by Comment Date, descending.' ) . + ''; } else { $this->print_table_description(); } diff --git a/src/wp-admin/includes/class-wp-list-table.php b/src/wp-admin/includes/class-wp-list-table.php index 4dfb825996..c5463f40f6 100644 --- a/src/wp-admin/includes/class-wp-list-table.php +++ b/src/wp-admin/includes/class-wp-list-table.php @@ -1361,7 +1361,11 @@ class WP_List_Table { } if ( isset( $sortable[ $column_key ] ) ) { - list( $orderby, $desc_first, $abbr, $orderby_text, $initial_order ) = $sortable[ $column_key ]; + $orderby = isset( $sortable[ $column_key ][0] ) ? $sortable[ $column_key ][0] : ''; + $desc_first = isset( $sortable[ $column_key ][1] ) ? $sortable[ $column_key ][1] : false; + $abbr = isset( $sortable[ $column_key ][2] ) ? $sortable[ $column_key ][2] : ''; + $orderby_text = isset( $sortable[ $column_key ][3] ) ? $sortable[ $column_key ][3] : ''; + $initial_order = isset( $sortable[ $column_key ][4] ) ? $sortable[ $column_key ][4] : ''; /* * We're in the initial view and there's no $_GET['orderby'] then check if the @@ -1397,9 +1401,13 @@ class WP_List_Table { $order = $desc_first ? 'desc' : 'asc'; } - $class[] = 'sortable'; - $class[] = 'desc' === $order ? 'asc' : 'desc'; - $order_text = 'asc' === $order ? __( 'Sort ascending.' ) : __( 'Sort descending.' ); + $class[] = 'sortable'; + $class[] = 'desc' === $order ? 'asc' : 'desc'; + /* translators: Hidden accessibility text. */ + $asc_text = __( 'Sort ascending.' ); + /* translators: Hidden accessibility text. */ + $desc_text = __( 'Sort descending.' ); + $order_text = 'asc' === $order ? $asc_text : $desc_text; } if ( '' !== $order_text ) { $order_text = ' ' . $order_text . ''; @@ -1428,7 +1436,7 @@ class WP_List_Table { * For the table initial view, information about initial orderby and order * should be provided via get_sortable_columns(). * - * @since 4.3.0 + * @since 6.3.0 * @access public */ public function print_table_description() { @@ -1457,8 +1465,11 @@ class WP_List_Table { foreach ( array_keys( $columns ) as $column_key ) { if ( isset( $sortable[ $column_key ] ) ) { - - list( $orderby, $desc_first, $abbr, $orderby_text, $initial_order ) = $sortable[ $column_key ]; + $orderby = isset( $sortable[ $column_key ][0] ) ? $sortable[ $column_key ][0] : ''; + $desc_first = isset( $sortable[ $column_key ][1] ) ? $sortable[ $column_key ][1] : false; + $abbr = isset( $sortable[ $column_key ][2] ) ? $sortable[ $column_key ][2] : ''; + $orderby_text = isset( $sortable[ $column_key ][3] ) ? $sortable[ $column_key ][3] : ''; + $initial_order = isset( $sortable[ $column_key ][4] ) ? $sortable[ $column_key ][4] : ''; if ( ! is_string( $orderby_text ) || '' === $orderby_text ) { return; @@ -1479,8 +1490,12 @@ class WP_List_Table { * and true in the sorted views when the actual $_GET['orderby'] is equal to $orderby. */ if ( $current_orderby == $orderby ) { - $order_text = 'asc' === $current_order ? __( 'Ascending.' ) : __( 'Descending.' ); - echo '' . $orderby_text . ' ' . $order_text . '

'; + /* translators: Hidden accessibility text. */ + $asc_text = __( 'Ascending.' ); + /* translators: Hidden accessibility text. */ + $desc_text = __( 'Descending.' ); + $order_text = 'asc' === $current_order ? $asc_text : $desc_text; + echo '' . $orderby_text . ' ' . $order_text . ''; return; }