[wp-trac] [WordPress Trac] #58236: theme.json customTemplates with child themes work wrong

WordPress Trac noreply at wordpress.org
Tue May 2 18:35:21 UTC 2023


#58236: theme.json customTemplates with child themes work wrong
--------------------------+-----------------------------
 Reporter:  thomask       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Editor        |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:  template      |
--------------------------+-----------------------------
 If you use child themes, then customTemplates in theme.json does not work
 and behaves badly

 1. It is not possible to delete or overwrite parent custom template -
 neither false nor empty array helps
 2. It is not possible to create a new custom template - it simply does not
 appear
 3. and what is strange - if you try to create your own custom template, it
 will throw away the naming and parent template at that position, so then
 when you select the template for the page, it doesn't show the title but
 the name. Example - if you make a child theme from twenty-three, and you
 type


 {{{
         "customTemplates": [
                 {
                         "name": "no-title",
                         "postTypes": [
                                 "page"
                         ],
                         "title": "No title"
                 }],
 }}}


 so when the page is selected, it will display 'blank' instead of 'Blank'
 (blank is the name of the first template in the parent twenty-three
 theme). If you try

 {{{
         "customTemplates": [{},
                 {
                         "name": "no-title",
                         "postTypes": [
                                 "page"
                         ],
                         "title": "No title"
                 }],
 }}}

 so when you select a page, it will display "blog-alternative" instead of
 Blog (Alternative) (blog-alternative is the second template in the parent
 theme).
 Child template can't be added like this even in the fourth position

 Unfortunately, this makes the whole thing completely unusable.

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


More information about the wp-trac mailing list