Skip to content

Commit

Permalink
Merge pull request #406 from WordPress/update/fse-theme-folders
Browse files Browse the repository at this point in the history
Update the FSE theme folders to the new proposed structure
  • Loading branch information
aristath authored Nov 25, 2021
2 parents 2a1caa0 + a80f1af commit f902901
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion checkbase.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ 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 ) ) {
if ( ! in_array( 'block-templates/index.html', $other_filenames, true ) && ! in_array( 'templates/index.html', $other_filenames, true ) ) {
return false;
}

Expand Down
18 changes: 8 additions & 10 deletions checks/class-fse-required-files-check.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,14 @@ public function check( $php_files, $css_files, $other_files ) {
array_push( $filenames, tc_filename( $php_key ) );
}

$musthave = array(
'block-templates/index.html',
'theme.json',
);

foreach ( $musthave as $file ) {
if ( ! in_array( $file, $filenames ) ) {
$this->error[] = sprintf( '<span class="tc-lead tc-required">' . __( 'REQUIRED', 'theme-check' ) . '</span>: ' . __( 'Could not find the file %s in the theme.', 'theme-check' ), '<strong>' . $file . '</strong>' );
$ret = false;
}
if ( ! in_array( 'theme.json', $filenames ) ) {
$this->error[] = sprintf( '<span class="tc-lead tc-required">' . __( 'REQUIRED', 'theme-check' ) . '</span>: ' . __( 'Could not find the file theme.json in the theme.', 'theme-check' ), '<strong>theme.json</strong>' );
$ret = false;
}

if ( ! in_array( 'block-templates/index.html', $filenames ) && ! in_array( 'templates/index.html', $filenames ) ) {
$this->error[] = sprintf( '<span class="tc-lead tc-required">' . __( 'REQUIRED', 'theme-check' ) . '</span>: ' . __( 'Could not find the index.html template in the theme.', 'theme-check' ), '<strong>index.html</strong>' );
$ret = false;
}

return $ret;
Expand Down

0 comments on commit f902901

Please sign in to comment.