Opened 8 hours ago
Last modified 8 hours ago
#65580 new defect (bug)
Incorrect template part slugs when the theme folder name ends with parts
| Reported by: | yashjawale | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Themes | Version: | trunk |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | template, rest-api |
Description
The _get_block_templates_files generates template name slugs that include directory names when the theme name ends with parts. As a result, it causes REST API requests to fail and prevents saving the changes.
Reproduction instructions
- Create a child theme using WP-CLI
wp scaffold child-theme auto-parts --parent_theme=twentytwentytwo --theme_name="Auto Parts"
- Copy the
partsdirectory from the parent theme.
cp -r wp-content/themes/twentytwentytwo/parts wp-content/themes/auto-parts/parts
- Go to the Site Editor -> Template Parts
- Confirm that template part slugs contain the directory name.
Both the parts with parts/ prefix & without them, fail to save changes in block editor.
Tested with current version of trunk & also present in 7.0.
Originally reported at Gutenberg repository in #42679 by @mamaduka
Change History (3)
This ticket was mentioned in PR #12399 on WordPress/wordpress-develop by @yashjawale.
8 hours ago
#1
- Keywords has-patch added
This ticket was mentioned in PR #12399 on WordPress/wordpress-develop by @yashjawale.
8 hours ago
#2
Trac ticket: https://core.trac.wordpress.org/ticket/65580
## Use of AI Tools
AI assistance: Yes
Tool(s): OpenCode
Model(s): DeepSeek V4 Flash
Used for: Checking initial implementation, followed by manual testing & verification
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)


Trac ticket: https://core.trac.wordpress.org/ticket/65580
## Use of AI Tools
AI assistance: Yes
Tool(s): OpenCode
Model(s): DeepSeek V4 Flash
Used for: Checking initial implementation, followed by manual testing & verification