[wp-trac] [WordPress Trac] #58132: Slashes used in block templates slug is a problem on Windows

WordPress Trac noreply at wordpress.org
Fri Apr 14 14:06:08 UTC 2023


#58132: Slashes used in block templates slug is a problem on Windows
-------------------------------------------------+-------------------------
 Reporter:  gaft                                 |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  6.2.1
Component:  General                              |     Version:  6.2
 Severity:  normal                               |  Resolution:
 Keywords:  needs-testing-info needs-testing     |     Focuses:
  reporter-feedback                              |
-------------------------------------------------+-------------------------

Comment (by gaft):

 Hello, I am testing it now in version 6.2. Here are the quick steps to
 take:

 1. Create a page and assign to a custom template

 {{{#!php
 wp_insert_post([
     'post_status' => 'publish',
     'post_type' => 'page',
     'post_title' => 'Custom Template Page',
     'meta_input' => [
         '_wp_page_template' => 'deep/folder/test',
     ],
 ]);
 }}}

 2. Add a template file named `test.html` in the theme under
 `templates/deep/folder`

 {{{
 custom-theme/
 ├── parts/
 ├── templates/
 │   ├── deep/
 │   │   └── folder/
 │   │       └── test.html
 │   ├── 404.html
 │   ├── index.html
 │   └── page.html
 ├── screenshot.png
 ├── styles.css
 └── theme.json
 }}}

 3. View the page at `/custom-template-page/`

 Currently, it only renders the `templates/page.html` because
 [https://core.trac.wordpress.org/browser/tags/6.2/src/wp-includes/block-
 template-utils.php#L981] evaluates to false

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58132#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list