Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion checkbase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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/<dir>/<theme>/ 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;
}

Expand Down
Loading