Themes: Update the base folders for templates and template parts in block themes.

Block Themes should now use the following folders:

 - templates instead of block-templates
 - parts instead of block-template-parts

Existing themes and folders will continue to work without impact.

Props bernhard-reiter.
Fixes #54493.


git-svn-id: https://develop.svn.wordpress.org/trunk@52247 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Riad Benguella
2021-11-25 10:57:19 +00:00
parent 90cdaabd2f
commit b90fc1b6dd
7 changed files with 40 additions and 17 deletions

View File

@@ -4084,5 +4084,6 @@ function create_initial_theme_features() {
* @return boolean Whether the current theme is a block-based theme or not.
*/
function wp_is_block_template_theme() {
return is_readable( get_theme_file_path( '/block-templates/index.html' ) );
return is_readable( get_theme_file_path( '/block-templates/index.html' ) ) ||
is_readable( get_theme_file_path( '/templates/index.html' ) );
}