Ticket #32170: 32170.11.diff
File 32170.11.diff, 4.3 KB (added by , 21 months ago) |
---|
-
src/wp-admin/includes/class-wp-comments-list-table.php
583 583 <?php 584 584 if ( ! isset( $_GET['orderby'] ) ) { 585 585 // In the initial view, Comments are ordered by comment's date but there's no column for that. 586 echo '<caption class="screen-reader-text">' . __( 'Ordered by Comment Date, descending.' ) . '</p>'; 586 echo '<caption class="screen-reader-text">' . 587 /* translators: Hidden accessibility text. */ 588 __( 'Ordered by Comment Date, descending.' ) . 589 '</caption>'; 587 590 } else { 588 591 $this->print_table_description(); 589 592 } -
src/wp-admin/includes/class-wp-list-table.php
1361 1361 } 1362 1362 1363 1363 if ( isset( $sortable[ $column_key ] ) ) { 1364 list( $orderby, $desc_first, $abbr, $orderby_text, $initial_order ) = $sortable[ $column_key ]; 1364 $orderby = isset( $sortable[ $column_key ][0] ) ? $sortable[ $column_key ][0] : ''; 1365 $desc_first = isset( $sortable[ $column_key ][1] ) ? $sortable[ $column_key ][1] : false; 1366 $abbr = isset( $sortable[ $column_key ][2] ) ? $sortable[ $column_key ][2] : ''; 1367 $orderby_text = isset( $sortable[ $column_key ][3] ) ? $sortable[ $column_key ][3] : ''; 1368 $initial_order = isset( $sortable[ $column_key ][4] ) ? $sortable[ $column_key ][4] : ''; 1365 1369 1366 1370 /* 1367 1371 * We're in the initial view and there's no $_GET['orderby'] then check if the … … 1397 1401 $order = $desc_first ? 'desc' : 'asc'; 1398 1402 } 1399 1403 1400 $class[] = 'sortable'; 1401 $class[] = 'desc' === $order ? 'asc' : 'desc'; 1402 $order_text = 'asc' === $order ? __( 'Sort ascending.' ) : __( 'Sort descending.' ); 1404 $class[] = 'sortable'; 1405 $class[] = 'desc' === $order ? 'asc' : 'desc'; 1406 /* translators: Hidden accessibility text. */ 1407 $asc_text = __( 'Sort ascending.' ); 1408 /* translators: Hidden accessibility text. */ 1409 $desc_text = __( 'Sort descending.' ); 1410 $order_text = 'asc' === $order ? $asc_text : $desc_text; 1403 1411 } 1404 1412 if ( '' !== $order_text ) { 1405 1413 $order_text = ' <span class="screen-reader-text">' . $order_text . '</span>'; … … 1428 1436 * For the table initial view, information about initial orderby and order 1429 1437 * should be provided via get_sortable_columns(). 1430 1438 * 1431 * @since 4.3.01439 * @since 6.3.0 1432 1440 * @access public 1433 1441 */ 1434 1442 public function print_table_description() { … … 1457 1465 foreach ( array_keys( $columns ) as $column_key ) { 1458 1466 1459 1467 if ( isset( $sortable[ $column_key ] ) ) { 1468 $orderby = isset( $sortable[ $column_key ][0] ) ? $sortable[ $column_key ][0] : ''; 1469 $desc_first = isset( $sortable[ $column_key ][1] ) ? $sortable[ $column_key ][1] : false; 1470 $abbr = isset( $sortable[ $column_key ][2] ) ? $sortable[ $column_key ][2] : ''; 1471 $orderby_text = isset( $sortable[ $column_key ][3] ) ? $sortable[ $column_key ][3] : ''; 1472 $initial_order = isset( $sortable[ $column_key ][4] ) ? $sortable[ $column_key ][4] : ''; 1460 1473 1461 list( $orderby, $desc_first, $abbr, $orderby_text, $initial_order ) = $sortable[ $column_key ];1462 1463 1474 if ( ! is_string( $orderby_text ) || '' === $orderby_text ) { 1464 1475 return; 1465 1476 } … … 1479 1490 * and true in the sorted views when the actual $_GET['orderby'] is equal to $orderby. 1480 1491 */ 1481 1492 if ( $current_orderby == $orderby ) { 1482 $order_text = 'asc' === $current_order ? __( 'Ascending.' ) : __( 'Descending.' ); 1483 echo '<caption class="screen-reader-text">' . $orderby_text . ' ' . $order_text . '</p>'; 1493 /* translators: Hidden accessibility text. */ 1494 $asc_text = __( 'Ascending.' ); 1495 /* translators: Hidden accessibility text. */ 1496 $desc_text = __( 'Descending.' ); 1497 $order_text = 'asc' === $current_order ? $asc_text : $desc_text; 1498 echo '<caption class="screen-reader-text">' . $orderby_text . ' ' . $order_text . '</caption>'; 1484 1499 1485 1500 return; 1486 1501 }