Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove index php requirement #425

Merged
merged 3 commits into from
Jul 20, 2022
Merged

Conversation

kafleg
Copy link
Member

@kafleg kafleg commented Jun 3, 2022

This PR will remove the REQUIRED index.php file from block themes. From WordPress 6.0, index.php file is optional in Block themes.

kafleg added 2 commits May 26, 2022 11:38
From WordPress 6.0, index.php file is optional. Theme will work without that file too. This PR will remove "REQUIRED: Could not find the file index.php in the theme."
Checked the required requirement of index.php from block themes
@kafleg kafleg requested review from acosmin and carolinan June 3, 2022 09:23
@acosmin
Copy link
Collaborator

acosmin commented Jun 8, 2022

This is for #422

The code works, but it needs to follow the Code Standards

@@ -68,6 +68,19 @@ public function check( $php_files, $css_files, $other_files ) {

$musthave = array( 'index.php', 'style.css', 'readme.txt' );

$fse_find = array_filter( array_keys( $other_files ), function( $file_name ) {
if ( false !== stripos( $file_name, 'templates/index.html' ) || false !== stripos( $file_name, 'block-templates/index.html' ) ) {
return true;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this not return true for the exception that was brought up on Trac here: https://core.trac.wordpress.org/ticket/54910,
classic themes that has a templates folder with a "silence is golden" index.html file.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably will :-) but I haven't seen any themes adding it in that way

We could probably add in the mix a check for the full-site-editing tag, but it's not future proof...

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wp_is_block_theme has similar implementation.

@carolinan carolinan requested a review from aristath July 19, 2022 05:31
@carolinan carolinan merged commit 3baffc7 into master Jul 20, 2022
them-es added a commit to them-es/starter-fse that referenced this pull request Oct 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants