[wp-trac] [WordPress Trac] #54829: Allow classic themes to be optionally block themes if 'templates' and 'parts' folders exists

WordPress Trac noreply at wordpress.org
Sat Jan 15 23:10:18 UTC 2022


#54829: Allow classic themes to be optionally block themes if 'templates' and
'parts' folders exists
-------------------------------------------+------------------------------
 Reporter:  exstheme                       |       Owner:  (none)
     Type:  enhancement                    |      Status:  new
 Priority:  normal                         |   Milestone:  Awaiting Review
Component:  Themes                         |     Version:  trunk
 Severity:  normal                         |  Resolution:
 Keywords:  needs-patch reporter-feedback  |     Focuses:
-------------------------------------------+------------------------------

Comment (by exstheme):

 Hello, dear @costdev !

 Many thanks for your quick response and understanding!

 Yes, you're absolutely right!
 We have Classic theme but want to add an option to our users to use new
 WP5.9 full site editor feature if they want to use it - without changing
 they theme.

 But as I mentioned earlier, currently even if `WP_Theme::is_block_theme()`
 is returning `false` - front end is using HTML block templates from
 `templates` and `parts` folders. So we need to add filter on the
 `theme_root` hook to return some dummy path - this is the only way that I
 could change this behavior if `templates` and `parts` folders exists.

 It would be great if we could just use, for example, some
 `add_theme_support( 'use_full_site_editing' )` feature on the
 `after_theme_setup` hook if user is check the appropriate theme option and
 only then  `templates` and `parts` folders start to work as in a regular
 block theme.


 Thank you very much once again!
 Best regards!

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


More information about the wp-trac mailing list