-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Site Editor: Consider compatibility regarding non-block themes and the Library menu #52150
Comments
cc @WordPress/gutenberg-design |
The proposal sounds reasonable for
If a theme adds support for both What do you think? |
I like that approach and it seems sound to me. I'm curious to hear from @WordPress/block-themers to see what we might be missing and to hear from broader themers who both know the experience of classic themes and have made the switch to block themes in various ways. |
I think the naming of |
Or, maybe it should be the other way around: that the pattern screen is always available for all themes unless disabled. |
The "current pattern library", the Inserter > Patterns > Explore all patterns, is not limited depending on the theme type, so why should the new screen be? 😄 |
That's a good point. But how would you get to the pattern library when a classic theme is active, Appearance > Patterns? Naturally it would only be possible to create / edit template parts when support is declared. |
I've long wished to have the Appearance > Patterns menu item (when it was still reusable blocks). That would be a great addition 👍 Additionally I'd love for the |
Thank you all for your input! Based on your input, I have the following ideas: For the classic theme, "Patterns" menu is displayed under "Appearance" menu, regardless of whether it supports If the classic theme supports By adding such as ccing @aaronrobertshaw Because in #51957, you are trying to control where the "Manage all patterns" links to, depending on whether it is a block-based theme or not, and I think this is relevant to this issue 🙏 |
@t-hamano I don't know that we need to present patterns and template parts separately for classic themes. It probably makes sense to reuse as much of the general pattern management experience as possible. So without The back button would return you to wp-admin. Note the exclusion of:
If the theme adds support for template parts, those three exclusions are revoked and become available. What do you think? |
Oh, I think that is a very good approach! However, we might need to decide how far to go with these changes in WP6.3. Personally, I think at least the following changes are acceptable:
|
I guess it depends on whether classic themes will be granted access to pattern management in general. If not, your suggestion makes sense. |
I believe that in the future all themes should have access to the Patterns management features of the Site Editor. Therefore, I would like to address the following steps. If you have other suggestions, please let me know. Backport to WordPress 6.3 (RC1)Themes that support Future implementationsFor non-block themes, add a Patterns menu under the Appearance menu, with or without Access rights managementAs I reported in #49713, if you reload a page in non-block themes, access is denied. More fine-grained access control based on paths and available features may be needed. |
Update: With #52656, the issue where non-block themes could unintentionally create template parts has been fixed. It would be difficult to backport to WordPress 6.3 due to time constraints to allow all themes to have access to the Patterns menu. Therefore, I will move this issue to "porting to 6.4" and continue work after the 6.3 release. |
Core Ticket: https://core.trac.wordpress.org/ticket/58827 |
Thanks for all the effort in wrangling this one and exploring options @t-hamano 👍 This issue is currently under the "Future Follow-ups" section of the Patterns tracking issue which I believe aligns with the plan outlined above. |
Update: In core, added a "Pattern" menu item under Classic Theme Appearance: https://core.trac.wordpress.org/changeset/57543 This completes the task for WordPress 6.5, but since the following needs to be addressed in the future, I would like to leave this issue open and punt it to WP6.6.
|
Sounds great. Thank you, @t-hamano, for seeing this through at each step. |
Update:
This roadmap is based on the fact that Gutenberg plugin needs to support WP6.4 and below. This means that under WP6.4, classic themes still cannot access the Site Editor's pattern page ( However, as mentioned in this comment, I learned that it is possible to filter I would like to try this approach. |
Update: I would like to work on the necessary tasks to officially publish the Site Editor Patterns page for all classic themes in WP6.6. My understanding is that the current specs for WP6.5 and expected specs for WP6.6 should be as follows: WP6.5
WP6.6
|
Thanks for diving in -- excited to see this slated finally for 6.6. Let me know what support you might need here too <3 |
Update: I'm working on this problem continuously, but most of the preparations are done. Once all the related tasks below are completed, this issue should be closed. Gutenberg PRs
Core ticket and PR |
Because this often comes up with many new features where we change the experience for classic themes, is there a filter in place where folks can roll back to the original experience @t-hamano ? |
If we want to change the Pattern submenu link to the previous one, we can use the following hook: function change_patterns_submenu_link() {
if ( ! wp_is_block_theme() ) {
global $submenu;
foreach ( $submenu['themes.php'] as $key => $item ) {
if ( 'site-editor.php?path=/patterns' === $item[2] ) {
$submenu['themes.php'][ $key ][2] = 'edit.php?post_type=wp_block';
}
}
}
}
add_action( 'admin_init', 'change_patterns_submenu_link' ); However, the "Manage patterns" menu on the block editor or via the command palette always links to the Patterns page in the site editor. |
All tasks on this issue have been completed and I would like to close it. The next step will be to expose the Patterns page to all "users" as well as all "themes" (See #61637). Thank you to everyone who was involved! |
What problem does this address?
For non-blocking themes, Template Parts Editor can be enabled with the following code:
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.
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.
If you have any good suggestions, please comment.
975467f9cbed70f1ec92c3069bdd2e07.mp4
The text was updated successfully, but these errors were encountered: