#54272 closed enhancement (fixed)
Allow block themes to be activated without index.php
Reported by: | poena | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 6.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Themes | Keywords: | has-patch commit add-to-field-guide |
Focuses: | template | Cc: |
Description
Block themes (themes built with support for full site editing) have to include an index.php file to be activated, even though the new format does not use index.php, but index.html
(inside a block-templates
folder).
Block themes should not need to include this unused file in order to be activated.
If the theme does not include index.php, this message is shown:
Template is missing. Standalone themes need to have a index.php template file
Attachments (4)
Change History (21)
#3
in reply to:
↑ 2
;
follow-up:
↓ 5
@
3 years ago
Replying to manfcarlo:
What are the security implications of omitting index.php?
In the theme is used only for the WP "router" and also as a fallback.
This ticket was mentioned in Slack in #core-themes by poena. View the logs.
3 years ago
#6
@
3 years ago
- Milestone changed from 5.9 to Future Release
As of yesterday, 5.9 is now in Feature Freeze. Moving this ticket to the next release cycle. But 6.0 is not yet available for selection. Moving it to Future Release
. Once 6.0 is available, please feel free to move it into that milestone.
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
3 years ago
#9
@
3 years ago
- Keywords dev-feedback needs-refresh added
This needs a refresh as block-templates
was replaced by simply templates
, plus it's unclear if we need to update themes to work without index.php
or include an empty index.php
as a requirement anyway.
#10
@
3 years ago
IMO we should remove the index.php requirement, I can't see what value it adds. I have added a new diff to achieve this.
#12
@
3 years ago
- Keywords commit added; dev-feedback needs-refresh removed
Thanks for the patches!
54272.3.diff is a minor adjustment to make the "or" part of the string translatable too.
#13
@
3 years ago
In 54272.4.diff:
- Check for
templates/index.html
first, as block themes would likely be more common in the future. - Update the documentation.
#14
in reply to:
↑ 2
@
3 years ago
Replying to manfcarlo:
What are the security implications of omitting index.php?
I think including an empty index.php
file to prevent directory listing may still be a good practice, but it does not have to be a requirement for themes.
Allow block themes without
index.php
if eitherindex.php
orblock-templates/index.html
is present in a theme folder, theme will activate without any issue. If a theme missing both, a notice will be shown as previous.