An incorrect template part slugs when the theme folder name ends with parts
#42679
Labels
[Feature] Themes
Questions or issues with incorporating or styling blocks in a theme.
[Type] Bug
An existing feature does not function as intended
Description
I noticed while working on #37943.
The
_get_block_templates_files
generates template name slugs that include directory names when the theme name ends withparts.
As a result, it causes REST API requests to fail and prevents saving the changes.I think the following lines are the cause of the issue - https://github.com/WordPress/wordpress-develop/blob/6.0/src/wp-includes/block-template-utils.php#L316-L322.
Step-by-step reproduction instructions
parts
directory from the parent theme.Screenshots, screen recording, code snippet
Environment info
WP 6.0.x with or without the Gutenberg plugin.
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: