diff --git a/src/wp-includes/class-wp-theme.php b/src/wp-includes/class-wp-theme.php
index d0607528b5..506a6c650c 100644
a
|
b
|
final class WP_Theme implements ArrayAccess { |
337 | 337 | |
338 | 338 | if ( ! $this->template ) { |
339 | 339 | $this->template = $this->stylesheet; |
340 | | if ( ! file_exists( $this->theme_root . '/' . $this->stylesheet . '/index.php' ) ) { |
| 340 | |
| 341 | $index_php_path = $this->theme_root . '/' . $this->stylesheet . '/index.php'; |
| 342 | $index_html_path = $this->theme_root . '/' . $this->stylesheet . '/block-templates/index.html'; |
| 343 | |
| 344 | if ( ! file_exists( $index_php_path ) && ! file_exists( $index_html_path ) ) { |
341 | 345 | $error_message = sprintf( |
342 | 346 | /* translators: 1: index.php, 2: Documentation URL, 3: style.css */ |
343 | 347 | __( 'Template is missing. Standalone themes need to have a %1$s template file. <a href="%2$s">Child themes</a> need to have a Template header in the %3$s stylesheet.' ), |
344 | | '<code>index.php</code>', |
| 348 | '<code>index.php</code> or <code>block-templates/index.html</code>', |
345 | 349 | __( 'https://developer.wordpress.org/themes/advanced-topics/child-themes/' ), |
346 | 350 | '<code>style.css</code>' |
347 | 351 | ); |
diff --git a/src/wp-includes/theme.php b/src/wp-includes/theme.php
index 384c056404..35c0ad07a6 100644
a
|
b
|
function validate_current_theme() { |
857 | 857 | return true; |
858 | 858 | } |
859 | 859 | |
860 | | if ( ! file_exists( get_template_directory() . '/index.php' ) ) { |
| 860 | if ( ! file_exists( get_template_directory() . '/index.php' ) && ! file_exists( get_template_directory() . '/block-templates/index.html' ) ) { |
861 | 861 | // Invalid. |
862 | 862 | } elseif ( ! file_exists( get_template_directory() . '/style.css' ) ) { |
863 | 863 | // Invalid. |