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.

Built from https://develop.svn.wordpress.org/trunk@52247


git-svn-id: http://core.svn.wordpress.org/trunk@51839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
youknowriad
2021-11-25 10:59:04 +00:00
parent 322b60f600
commit 5d73860e5c
3 changed files with 37 additions and 14 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' ) );
}