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/class-theme-upgrader.php

    r47122 r47219  
    368368                $maintenance = ( is_multisite() && ! empty( $themes ) );
    369369                foreach ( $themes as $theme ) {
    370                         $maintenance = $maintenance || $theme == get_stylesheet() || $theme == get_template();
     370                        $maintenance = $maintenance || get_stylesheet() === $theme || get_template() === $theme;
    371371                }
    372372                if ( $maintenance ) {
    … …  
    540540                $theme = isset( $theme['theme'] ) ? $theme['theme'] : '';
    541541
    542                 if ( $theme != get_stylesheet() ) { // If not current.
     542                if ( get_stylesheet() !== $theme ) { // If not current.
    543543                        return $return;
    544544                }
    … …  
    571571                $theme = isset( $theme['theme'] ) ? $theme['theme'] : '';
    572572
    573                 if ( $theme != get_stylesheet() ) { // If not current.
     573                if ( get_stylesheet() !== $theme ) { // If not current.
    574574                        return $return;
    575575                }
    576576
    577577                // Ensure stylesheet name hasn't changed after the upgrade:
    578                 if ( $theme == get_stylesheet() && $theme != $this->result['destination_name'] ) {
     578                if ( get_stylesheet() === $theme && $theme != $this->result['destination_name'] ) {
    579579                        wp_clean_themes_cache();
    580580                        $stylesheet = $this->result['destination_name'];
Note: See TracChangeset for help on using the changeset viewer.