[wp-trac] [WordPress Trac] #57757: _get_block_templates_files fails when code is stored in map called templates

WordPress Trac noreply at wordpress.org
Fri Feb 17 16:40:42 UTC 2023


#57757: _get_block_templates_files fails when code is stored in map called
templates
--------------------------+-----------------------------
 Reporter:  bastolen97    |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Themes        |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 I was setting up a local template for a Bedrock repository in a folder
 called `/Users/bas/git/work/templates/wp`, but because the path includes
 `templates` FSE themes using a `templates` folder instead of a `block-
 templates` folder will not work. This has to do with the way the slug of
 the template is decided by cutting of all the text up until `templates/`,
 but not checking if this text appears twice. By splitting the filename on
 this `base_path` it will actually work.

 My WPSE question from before solving the issue:
 https://wordpress.stackexchange.com/questions/413959/full-site-editing-
 templates-folder-vs-block-templates

 I have already fixed this issue in Github, will create a PR as soon as
 this is created.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57757>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list