Make WordPress Core

Changeset 56260


Ignore:
Timestamp:
07/18/2023 02:03:57 PM (20 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison for static strings in wp-admin/includes/class-wp-list-table.php.

Follow-up to [55971], [56004].

See #32170, #57839.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-list-table.php

    r56174 r56260  
    11161116     * In the second format, passing true as second parameter will make the initial
    11171117     * sorting order be descending. Following parameters add a short column name to
    1118      * be used as 'abbr' attribute, a translatable string for the current sorting
     1118     * be used as 'abbr' attribute, a translatable string for the current sorting,
    11191119     * and the initial order for the initial sorted column, 'asc' or 'desc' (default: false).
    11201120     *
     
    13261326
    13271327        // Not in the initial view and descending order.
    1328         if ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] ) {
     1328        if ( isset( $_GET['order'] ) && 'desc' === $_GET['order'] ) {
    13291329            $current_order = 'desc';
    13301330        } else {
    1331             // The initial view is not always 'asc' we'll take care of this below.
     1331            // The initial view is not always 'asc', we'll take care of this below.
    13321332            $current_order = 'asc';
    13331333        }
     
    13891389                if ( $current_orderby === $orderby ) {
    13901390                    // The sorted column. The `aria-sort` attribute must be set only on the sorted column.
    1391                     if ( 'asc' == $current_order ) {
     1391                    if ( 'asc' === $current_order ) {
    13921392                        $order          = 'desc';
    13931393                        $aria_sort_attr = ' aria-sort="ascending"';
     
    13961396                        $aria_sort_attr = ' aria-sort="descending"';
    13971397                    }
     1398
    13981399                    $class[] = 'sorted';
    13991400                    $class[] = $current_order;
     
    14081409                    $class[] = 'sortable';
    14091410                    $class[] = 'desc' === $order ? 'asc' : 'desc';
     1411
    14101412                    /* translators: Hidden accessibility text. */
    14111413                    $asc_text = __( 'Sort ascending.' );
     
    14141416                    $order_text = 'asc' === $order ? $asc_text : $desc_text;
    14151417                }
     1418
    14161419                if ( '' !== $order_text ) {
    14171420                    $order_text = ' <span class="screen-reader-text">' . $order_text . '</span>';
     
    14601463
    14611464        // Not in the initial view and descending order.
    1462         if ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] ) {
     1465        if ( isset( $_GET['order'] ) && 'desc' === $_GET['order'] ) {
    14631466            $current_order = 'desc';
    14641467        } else {
    1465             // The initial view is not always 'asc' we'll take care of this below.
     1468            // The initial view is not always 'asc', we'll take care of this below.
    14661469            $current_order = 'asc';
    14671470        }
     
    14941497                 * and true in the sorted views when the actual $_GET['orderby'] is equal to $orderby.
    14951498                 */
    1496                 if ( $current_orderby == $orderby ) {
     1499                if ( $current_orderby === $orderby ) {
    14971500                    /* translators: Hidden accessibility text. */
    14981501                    $asc_text = __( 'Ascending.' );
Note: See TracChangeset for help on using the changeset viewer.