Make WordPress Core


Ignore:
Timestamp:
02/09/2020 04:52:28 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use Yoda conditions where appropriate.

See #49222.

File:
1 edited

Legend:

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

    r47122 r47219  
    7171
    7272        if ( ! empty( $_REQUEST['mode'] ) ) {
    73             $mode = $_REQUEST['mode'] === 'excerpt' ? 'excerpt' : 'list';
     73            $mode = 'excerpt' === $_REQUEST['mode'] ? 'excerpt' : 'list';
    7474            set_user_setting( 'sites_list_mode', $mode );
    7575        } else {
     
    264264
    265265        foreach ( $statuses as $status => $label_count ) {
    266             $current_link_attributes = $requested_status === $status || ( $requested_status === '' && 'all' === $status )
     266            $current_link_attributes = $requested_status === $status || ( '' === $requested_status && 'all' === $status )
    267267                ? ' class="current" aria-current="page"'
    268268                : '';
     
    477477        }
    478478
    479         echo ( $blog['last_updated'] === '0000-00-00 00:00:00' ) ? __( 'Never' ) : mysql2date( $date, $blog['last_updated'] );
     479        echo ( '0000-00-00 00:00:00' === $blog['last_updated'] ) ? __( 'Never' ) : mysql2date( $date, $blog['last_updated'] );
    480480    }
    481481
     
    498498        }
    499499
    500         if ( $blog['registered'] === '0000-00-00 00:00:00' ) {
     500        if ( '0000-00-00 00:00:00' === $blog['registered'] ) {
    501501            echo '—';
    502502        } else {
     
    586586
    587587            foreach ( $this->status_list as $status => $col ) {
    588                 if ( $blog[ $status ] == 1 ) {
     588                if ( 1 == $blog[ $status ] ) {
    589589                    $class = " class='{$col[0]}'";
    590590                }
     
    694694        $actions['backend'] = "<a href='" . esc_url( get_admin_url( $blog['blog_id'] ) ) . "' class='edit'>" . __( 'Dashboard' ) . '</a>';
    695695        if ( get_network()->site_id != $blog['blog_id'] ) {
    696             if ( $blog['deleted'] == '1' ) {
     696            if ( '1' == $blog['deleted'] ) {
    697697                $actions['activate'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=activateblog&amp;id=' . $blog['blog_id'] ), 'activateblog_' . $blog['blog_id'] ) ) . '">' . __( 'Activate' ) . '</a>';
    698698            } else {
     
    700700            }
    701701
    702             if ( $blog['archived'] == '1' ) {
     702            if ( '1' == $blog['archived'] ) {
    703703                $actions['unarchive'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=unarchiveblog&amp;id=' . $blog['blog_id'] ), 'unarchiveblog_' . $blog['blog_id'] ) ) . '">' . __( 'Unarchive' ) . '</a>';
    704704            } else {
     
    706706            }
    707707
    708             if ( $blog['spam'] == '1' ) {
     708            if ( '1' == $blog['spam'] ) {
    709709                $actions['unspam'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=unspamblog&amp;id=' . $blog['blog_id'] ), 'unspamblog_' . $blog['blog_id'] ) ) . '">' . _x( 'Not Spam', 'site' ) . '</a>';
    710710            } else {
Note: See TracChangeset for help on using the changeset viewer.