From 37d29f201e50f6a7b200d24e388c459efb7c546a Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Thu, 19 Mar 2026 13:22:47 +0100 Subject: [PATCH] Skip classic theme checks when the block theme is in a subfolder --- checkbase.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/checkbase.php b/checkbase.php index 7c03305b..1a87e7ef 100644 --- a/checkbase.php +++ b/checkbase.php @@ -351,7 +351,16 @@ function tc_adapt_checks_for_fse_themes( $php_files, $css_files, $other_files ) } // Check whether this is a FSE theme by searching for an index.html block template. - if ( ! in_array( 'block-templates/index.html', $other_filenames, true ) && ! in_array( 'templates/index.html', $other_filenames, true ) ) { + // Match by suffix so themes nested under /themes/// are supported. + $has_fse_index_template = false; + foreach ( $other_filenames as $filename ) { + if ( preg_match( '!(^|/)(block-templates|templates)/index\.html$!i', $filename ) ) { + $has_fse_index_template = true; + break; + } + } + + if ( ! $has_fse_index_template ) { return false; }