Changeset 57847
- Timestamp:
- 03/16/2024 01:16:16 PM (13 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme.php
r57608 r57847 353 353 $default_theme_slug = array_search( $this->headers['Name'], self::$default_themes, true ); 354 354 if ( $default_theme_slug ) { 355 if ( basename( $this->stylesheet ) != $default_theme_slug ) {355 if ( basename( $this->stylesheet ) !== $default_theme_slug ) { 356 356 $this->headers['Name'] .= '/' . $this->stylesheet; 357 357 } … … 418 418 419 419 // If we got our data from cache, we can assume that 'template' is pointing to the right place. 420 if ( ! is_array( $cache ) && $this->template != $this->stylesheet && ! file_exists( $this->theme_root . '/' . $this->template . '/index.php' ) ) { 420 if ( ! is_array( $cache ) 421 && $this->template !== $this->stylesheet 422 && ! file_exists( $this->theme_root . '/' . $this->template . '/index.php' ) 423 ) { 421 424 /* 422 425 * If we're in a directory of themes inside /themes, look for the parent nearby. … … 426 429 $directories = search_theme_directories(); 427 430 428 if ( '.' !== $parent_dir && file_exists( $this->theme_root . '/' . $parent_dir . '/' . $this->template . '/index.php' ) ) { 431 if ( '.' !== $parent_dir 432 && file_exists( $this->theme_root . '/' . $parent_dir . '/' . $this->template . '/index.php' ) 433 ) { 429 434 $this->template = $parent_dir . '/' . $this->template; 430 435 } elseif ( $directories && isset( $directories[ $this->template ] ) ) { … … 461 466 462 467 // Set the parent, if we're a child theme. 463 if ( $this->template != $this->stylesheet ) {468 if ( $this->template !== $this->stylesheet ) { 464 469 // If we are a parent, then there is a problem. Only two generations allowed! Cancel things out. 465 if ( $_child instanceof WP_Theme && $_child->template == $this->stylesheet ) {470 if ( $_child instanceof WP_Theme && $_child->template === $this->stylesheet ) { 466 471 $_child->parent = null; 467 472 $_child->errors = new WP_Error( … … 485 490 ); 486 491 // The two themes actually reference each other with the Template header. 487 if ( $_child->stylesheet == $this->template ) {492 if ( $_child->stylesheet === $this->template ) { 488 493 $this->errors = new WP_Error( 489 494 'theme_parent_invalid', … … 1715 1720 } 1716 1721 1717 $current = get_current_blog_id() == $blog_id;1722 $current = get_current_blog_id() === $blog_id; 1718 1723 1719 1724 if ( $current ) {
Note: See TracChangeset
for help on using the changeset viewer.