-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
What problem does this address?
For non-blocking themes, Template Parts Editor can be enabled with the following code:
add_theme_support( 'block-template-parts' );
I believe that the addition of the Library (aka Patterns) menu to the Site Editor has caused this opt-in support to behave differently than originally expected, resulting in the following problems.
- When the Appearance > Template Parts menu is accessed, a list of all template parts is displayed, but the upper Library menu can be accessed. This means that new template part will be allowed to be added. As I mentioned in this comment, this should not be the expected behavior in a non-block theme.
- I'm expecting to opt in to the template parts editor only, but it also provides pattern (synced/non-synced) management functionality. While this may be gratifying, I don't think it is the expected behavior of this theme support.
What is your proposed solution?
In order to maintain the functionality originally intended by this theme support, I suggest not allowing access to the Library menu. This means that when you press the Back button in the All Template Part menu, you will return to the Admin page, not the Library.
However, in this case, the non-block theme will not be able to take advantage of the convenient pattern management features and new features that may be implemented in the Libary menu in the future.
Alternatively, new opt-in support for accessing the Library menu could be introduced.
add_theme_support( 'library' );
// or
add_theme_support( 'patterns' );
If you have any good suggestions, please comment.