mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 12:50:28 +00:00
Themes: Accept valid block themes.
Updates theme validation to accept block themes. This replaces the requirement for an `index.php` with a requirement for either an `index.php`, `/templates/index.html` or the deprecated `/block-templates/index.html`. Validation is updated for theme uploads, within `WP_Theme::__construct` and `validate_current_theme()`. A block theme using the deprecated file structure is now included in the unit tests. Props peterwilsoncc, sergeybiryukov, hellofromtonya, costdev, azaozz, gziolo, FlorianBrinkmann, Boniu91, aristath, poena, audrasjb. Fixes #55754. git-svn-id: https://develop.svn.wordpress.org/trunk@53416 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -861,7 +861,9 @@ function validate_current_theme() {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( ! file_exists( get_template_directory() . '/templates/index.html' )
|
||||
if (
|
||||
! file_exists( get_template_directory() . '/templates/index.html' )
|
||||
&& ! file_exists( get_template_directory() . '/block-templates/index.html' ) // Deprecated path support since 5.9.0.
|
||||
&& ! file_exists( get_template_directory() . '/index.php' )
|
||||
) {
|
||||
// Invalid.
|
||||
|
||||
Reference in New Issue
Block a user