create-block-theme
create-block-theme copied to clipboard
Prototype: Add custom templates
This is a prototype of how plugins might want to add custom templates to a theme without needing to modify the theme itself.
This works by attaching to two filters: get_block_template
and get_block_templates
. The new custom template is added programatically to the theme using these filters.
This approach could be used by plugins who require themes to have specific templates in order to function, without having to actually add the files to the theme.
One problem with this approach is that it makes some assumptions about the base template of the theme.