diff --git a/src/wp-includes/class-wp-theme.php b/src/wp-includes/class-wp-theme.php index 3b520782c192..43383dea9eb5 100644 --- a/src/wp-includes/class-wp-theme.php +++ b/src/wp-includes/class-wp-theme.php @@ -363,8 +363,7 @@ public function __construct( $theme_dir, $theme_root, $_child = null ) { $theme_path = $this->theme_root . '/' . $this->stylesheet; if ( - ! file_exists( $theme_path . '/templates/index.html' ) - && ! file_exists( $theme_path . '/block-templates/index.html' ) // Deprecated path support since 5.9.0. + ! $this->is_block_theme() && ! file_exists( $theme_path . '/index.php' ) ) { $error_message = sprintf( @@ -380,7 +379,7 @@ public function __construct( $theme_dir, $theme_root, $_child = null ) { $this->cache_add( 'theme', array( - 'block_theme' => $this->is_block_theme(), + 'block_theme' => $this->block_theme, 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet,