WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/02/2019 11:41:16 PM (17 months ago)
Author:
pento
Message:

Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes.

See #47632.

File:
1 edited

Legend:

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

    r45080 r45590  
    263263            // Default themes always trump their pretenders.
    264264            // Properly identify default themes that are inside a directory within wp-content/themes.
    265             if ( $default_theme_slug = array_search( $this->headers['Name'], self::$default_themes ) ) {
     265            $default_theme_slug = array_search( $this->headers['Name'], self::$default_themes );
     266            if ( $default_theme_slug ) {
    266267                if ( basename( $this->stylesheet ) != $default_theme_slug ) {
    267268                    $this->headers['Name'] .= '/' . $this->stylesheet;
     
    286287
    287288        // (If template is set from cache [and there are no errors], we know it's good.)
    288         if ( ! $this->template && ! ( $this->template = $this->headers['Template'] ) ) {
     289        if ( ! $this->template ) {
     290            $this->template = $this->headers['Template'];
     291        }
     292
     293        if ( ! $this->template ) {
    289294            $this->template = $this->stylesheet;
    290295            if ( ! file_exists( $this->theme_root . '/' . $this->stylesheet . '/index.php' ) ) {
     
    314319            // If we're in a directory of themes inside /themes, look for the parent nearby.
    315320            // wp-content/themes/directory-of-themes/*
    316             $parent_dir = dirname( $this->stylesheet );
     321            $parent_dir  = dirname( $this->stylesheet );
     322            $directories = search_theme_directories();
    317323            if ( '.' != $parent_dir && file_exists( $this->theme_root . '/' . $parent_dir . '/' . $this->template . '/index.php' ) ) {
    318324                $this->template = $parent_dir . '/' . $this->template;
    319             } elseif ( ( $directories = search_theme_directories() ) && isset( $directories[ $this->template ] ) ) {
     325            } elseif ( $directories && isset( $directories[ $this->template ] ) ) {
    320326                // Look for the template in the search_theme_directories() results, in case it is in another theme root.
    321327                // We don't look into directories of themes, just the theme root.
     
    669675            wp_cache_delete( $key . '-' . $this->cache_hash, 'themes' );
    670676        }
    671         $this->template = $this->textdomain_loaded = $this->theme_root_uri = $this->parent = $this->errors = $this->headers_sanitized = $this->name_translated = null;
    672         $this->headers  = array();
     677        $this->template          = null;
     678        $this->textdomain_loaded = null;
     679        $this->theme_root_uri    = null;
     680        $this->parent            = null;
     681        $this->errors            = null;
     682        $this->headers_sanitized = null;
     683        $this->name_translated   = null;
     684        $this->headers           = array();
    673685        $this->__construct( $this->stylesheet, $this->theme_root );
    674686    }
     
    13181330        }
    13191331
    1320         $path = $this->get_stylesheet_directory();
    1321         if ( $domainpath = $this->get( 'DomainPath' ) ) {
     1332        $path       = $this->get_stylesheet_directory();
     1333        $domainpath = $this->get( 'DomainPath' );
     1334        if ( $domainpath ) {
    13221335            $path .= $domainpath;
    13231336        } else {
Note: See TracChangeset for help on using the changeset viewer.