Changeset 45590 for trunk/src/wp-includes/class-wp-theme.php
- Timestamp:
- 07/02/2019 11:41:16 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme.php
r45080 r45590 263 263 // Default themes always trump their pretenders. 264 264 // 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 ) { 266 267 if ( basename( $this->stylesheet ) != $default_theme_slug ) { 267 268 $this->headers['Name'] .= '/' . $this->stylesheet; … … 286 287 287 288 // (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 ) { 289 294 $this->template = $this->stylesheet; 290 295 if ( ! file_exists( $this->theme_root . '/' . $this->stylesheet . '/index.php' ) ) { … … 314 319 // If we're in a directory of themes inside /themes, look for the parent nearby. 315 320 // wp-content/themes/directory-of-themes/* 316 $parent_dir = dirname( $this->stylesheet ); 321 $parent_dir = dirname( $this->stylesheet ); 322 $directories = search_theme_directories(); 317 323 if ( '.' != $parent_dir && file_exists( $this->theme_root . '/' . $parent_dir . '/' . $this->template . '/index.php' ) ) { 318 324 $this->template = $parent_dir . '/' . $this->template; 319 } elseif ( ( $directories = search_theme_directories() )&& isset( $directories[ $this->template ] ) ) {325 } elseif ( $directories && isset( $directories[ $this->template ] ) ) { 320 326 // Look for the template in the search_theme_directories() results, in case it is in another theme root. 321 327 // We don't look into directories of themes, just the theme root. … … 669 675 wp_cache_delete( $key . '-' . $this->cache_hash, 'themes' ); 670 676 } 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(); 673 685 $this->__construct( $this->stylesheet, $this->theme_root ); 674 686 } … … 1318 1330 } 1319 1331 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 ) { 1322 1335 $path .= $domainpath; 1323 1336 } else {
Note: See TracChangeset
for help on using the changeset viewer.