Make WordPress Core


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

Coding Standards: Use Yoda conditions where appropriate.

See #49222.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/user.php

    r47156 r47219  
    769769        $site_capabilities_key = $wpdb->base_prefix . $blog_id . '_capabilities';
    770770
    771         if ( isset( $keys[ $base_capabilities_key ] ) && $blog_id == 1 ) {
     771        if ( isset( $keys[ $base_capabilities_key ] ) && 1 == $blog_id ) {
    772772                return true;
    773773        }
     
    903903
    904904        if ( 'time' == $strategy ) {
    905                 if ( is_multisite() && $site_id != get_current_blog_id() ) {
     905                if ( is_multisite() && get_current_blog_id() != $site_id ) {
    906906                        switch_to_blog( $site_id );
    907907                        $avail_roles = wp_roles()->get_names();
     
    18731873
    18741874                if ( isset( $userdata['spam'] ) && $userdata['spam'] != $old_user_data->spam ) {
    1875                         if ( $userdata['spam'] == 1 ) {
     1875                        if ( 1 == $userdata['spam'] ) {
    18761876                                /**
    18771877                                 * Fires after the user is marked as a SPAM user.
     
    24942494
    24952495        // Check the username.
    2496         if ( $sanitized_user_login == '' ) {
     2496        if ( '' == $sanitized_user_login ) {
    24972497                $errors->add( 'empty_username', __( '<strong>Error</strong>: Please enter a username.' ) );
    24982498        } elseif ( ! validate_username( $user_login ) ) {
     
    25112511
    25122512        // Check the email address.
    2513         if ( $user_email == '' ) {
     2513        if ( '' == $user_email ) {
    25142514                $errors->add( 'empty_email', __( '<strong>Error</strong>: Please type your email address.' ) );
    25152515        } elseif ( ! is_email( $user_email ) ) {
     
    26782678        $prefix = $wpdb->get_blog_prefix( $site_id );
    26792679
    2680         if ( is_multisite() && $site_id != get_current_blog_id() ) {
     2680        if ( is_multisite() && get_current_blog_id() != $site_id ) {
    26812681                switch_to_blog( $site_id );
    26822682                $role_names = wp_roles()->get_names();
Note: See TracChangeset for help on using the changeset viewer.