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

    r47198 r47219  
    501501                }
    502502                foreach ( $dirs as $dir ) {
    503                         if ( ! is_dir( $theme_root . '/' . $dir ) || $dir[0] == '.' || $dir == 'CVS' ) {
     503                        if ( ! is_dir( $theme_root . '/' . $dir ) || '.' === $dir[0] || 'CVS' === $dir ) {
    504504                                continue;
    505505                        }
     
    521521                                }
    522522                                foreach ( $sub_dirs as $sub_dir ) {
    523                                         if ( ! is_dir( $theme_root . '/' . $dir . '/' . $sub_dir ) || $dir[0] == '.' || $dir == 'CVS' ) {
     523                                        if ( ! is_dir( $theme_root . '/' . $dir . '/' . $sub_dir ) || '.' === $dir[0] || 'CVS' === $dir ) {
    524524                                                continue;
    525525                                        }
     
    554554        }
    555555
    556         if ( $theme_roots != get_site_transient( 'theme_roots' ) ) {
     556        if ( get_site_transient( 'theme_roots' ) != $theme_roots ) {
    557557                set_site_transient( 'theme_roots', $theme_roots, $cache_expiration );
    558558        }
     
    16491649        $color = get_background_color();
    16501650
    1651         if ( $color === get_theme_support( 'custom-background', 'default-color' ) ) {
     1651        if ( get_theme_support( 'custom-background', 'default-color' ) === $color ) {
    16521652                $color = false;
    16531653        }
Note: See TracChangeset for help on using the changeset viewer.