-
Notifications
You must be signed in to change notification settings - Fork 112
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
Conversation
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
This is for #422 The code works, but it needs to follow the Code Standards |
checks/class-file-check.php
Outdated
@@ -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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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.
FSE block themes can be activated without index.php https://core.trac.wordpress.org/ticket/54272 WordPress/theme-check#425
This PR will remove the REQUIRED index.php file from block themes. From WordPress 6.0, index.php file is optional in Block themes.