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-admin/includes/ms.php

    r47119 r47219  
    2121        }
    2222
    23         if ( $file['error'] != '0' ) { // There's already an error.
     23        if ( '0' != $file['error'] ) { // There's already an error.
    2424                return $file;
    2525        }
     
    4646        }
    4747
    48         if ( $file['error'] != '0' && ! isset( $_POST['html-upload'] ) && ! wp_doing_ajax() ) {
     48        if ( '0' != $file['error'] && ! isset( $_POST['html-upload'] ) && ! wp_doing_ajax() ) {
    4949                wp_die( $file['error'] . ' <a href="javascript:history.go(-1)">' . __( 'Back' ) . '</a>' );
    5050        }
     
    549549 */
    550550function sync_category_tag_slugs( $term, $taxonomy ) {
    551         if ( global_terms_enabled() && ( $taxonomy == 'category' || $taxonomy == 'post_tag' ) ) {
     551        if ( global_terms_enabled() && ( 'category' === $taxonomy || 'post_tag' === $taxonomy ) ) {
    552552                if ( is_object( $term ) ) {
    553553                        $term->slug = sanitize_title( $term->name );
     
    645645                $code_lang = basename( $val, '.mo' );
    646646
    647                 if ( $code_lang == 'en_US' ) { // American English.
     647                if ( 'en_US' === $code_lang ) { // American English.
    648648                        $flag          = true;
    649649                        $ae            = __( 'American English' );
    650650                        $output[ $ae ] = '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang, false ) . '> ' . $ae . '</option>';
    651                 } elseif ( $code_lang == 'en_GB' ) { // British English.
     651                } elseif ( 'en_GB' === $code_lang ) { // British English.
    652652                        $flag          = true;
    653653                        $be            = __( 'British English' );
     
    659659        }
    660660
    661         if ( $flag === false ) { // WordPress English.
     661        if ( false === $flag ) { // WordPress English.
    662662                $output[] = '<option value=""' . selected( $current, '', false ) . '>' . __( 'English' ) . '</option>';
    663663        }
     
    726726                return $data;
    727727        }
    728         if ( $data['post_type'] != 'page' ) {
     728        if ( 'page' !== $data['post_type'] ) {
    729729                return $data;
    730730        }
    731         if ( ! isset( $data['post_name'] ) || $data['post_name'] == '' ) {
     731        if ( ! isset( $data['post_name'] ) || '' === $data['post_name'] ) {
    732732                return $data;
    733733        }
     
    814814 */
    815815function can_edit_network( $network_id ) {
    816         if ( $network_id == get_current_network_id() ) {
     816        if ( get_current_network_id() == $network_id ) {
    817817                $result = true;
    818818        } else {
     
    874874        $allusers = (array) $_POST['allusers'];
    875875        foreach ( $allusers as $user_id ) {
    876                 if ( $user_id != '' && $user_id != '0' ) {
     876                if ( '' != $user_id && '0' != $user_id ) {
    877877                        $delete_user = get_userdata( $user_id );
    878878
Note: See TracChangeset for help on using the changeset viewer.