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-users-list-table.php

    r47122 r47219  
    5555        }
    5656
    57         if ( $role === 'super' ) {
     57        if ( 'super' === $role ) {
    5858            $args['login__in'] = get_super_admins();
    5959        }
     
    8585
    8686        if ( ! empty( $_REQUEST['mode'] ) ) {
    87             $mode = $_REQUEST['mode'] === 'excerpt' ? 'excerpt' : 'list';
     87            $mode = 'excerpt' === $_REQUEST['mode'] ? 'excerpt' : 'list';
    8888            set_user_setting( 'network_users_list_mode', $mode );
    8989        } else {
     
    138138        $total_admins = count( $super_admins );
    139139
    140         $current_link_attributes = $role !== 'super' ? ' class="current" aria-current="page"' : '';
     140        $current_link_attributes = 'super' !== $role ? ' class="current" aria-current="page"' : '';
    141141        $role_links              = array();
    142142        $role_links['all']       = sprintf(
     
    155155            )
    156156        );
    157         $current_link_attributes = $role === 'super' ? ' class="current" aria-current="page"' : '';
     157        $current_link_attributes = 'super' === $role ? ' class="current" aria-current="page"' : '';
    158158        $role_links['super']     = sprintf(
    159159            '<a href="%s"%s>%s</a>',
     
    372372            }
    373373
    374             $path         = ( $val->path === '/' ) ? '' : $val->path;
     374            $path         = ( '/' === $val->path ) ? '' : $val->path;
    375375            $site_classes = array( 'site-' . $val->site_id );
    376376            /**
     
    397397
    398398            $class = '';
    399             if ( $val->spam == 1 ) {
     399            if ( 1 == $val->spam ) {
    400400                $class .= 'site-spammed ';
    401401            }
    402             if ( $val->mature == 1 ) {
     402            if ( 1 == $val->mature ) {
    403403                $class .= 'site-mature ';
    404404            }
    405             if ( $val->deleted == 1 ) {
     405            if ( 1 == $val->deleted ) {
    406406                $class .= 'site-deleted ';
    407407            }
    408             if ( $val->archived == 1 ) {
     408            if ( 1 == $val->archived ) {
    409409                $class .= 'site-archived ';
    410410            }
Note: See TracChangeset for help on using the changeset viewer.