Gutenberg_Block_Template 'theme' property is confusing, because templates might be added by plugins instead of themes #37401
Labels
[Feature] Extensibility
The ability to extend blocks or the editing experience
[Feature] Site Editor
Related to the overarching Site Editor (formerly "full site editing")
[Feature] Templates API
Related to API powering block template functionality in the Site Editor
Description
Currently, the
Gutenberg_Block_Template
has atheme
property that is used to indicate which theme the template belongs to. That works great for themes, but it's confusing when plugins add templates: should plugin devs set the plugin name in thetheme
property? Currently, the answer is yes, but it's confusing!I wonder if
theme
property could be renamed to something that encompasses themes and plugins. So a template added by a plugin, instead of being defined like this:would be defined like something along these lines:
I know we are late in the WP 5.9 release cycle so we might not be able to make a change like that at this point. In that case, I would like to clarify if the recommended way for plugins to add templates is to use the
theme
property.Any thoughts on this @carolinan @talldan @kevin940726?
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: