-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Update the opt-in for the stylebook in classic themes #68940
Conversation
Flaky tests detected in dc249b2. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/13029645509
|
I added the needs backport label, but I see that the PR for the trac ticket from the previous PR is still a draft: WordPress/wordpress-develop#7865 And is conflicting with the new site editor paths: https://github.com/WordPress/wordpress-develop/pull/7903/files |
@carolinan, what are the blockers for this PR? |
#68959 |
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
#68959 doesn't have to block this. It's a pre-existing bug here we're just changing the theme supports flag. |
Changing the theme support here only changes the menu item, nothing else, and if that is what we want to do, no, a theme support is not needed at all because developers can already change the menu items. |
Then I misunderstood the #68036. I thought the request was to use different theme support flags and make this feature opt-in for classic theme developers, which this PR does. The new site redirection logic is a separate enhancement; related issues will be resolved separately.
Developers can do a lot, but frameworks still provide APIs to make certain things more manageable. |
I don't understand. It does not opt-in to the style book to me. It opts in to the menu item. |
What should have been obvious, is that there is also a Styles menu item in the Site Editor Sidebar, that can be found if you open the Patterns page and then go back to the start of the Site Editor. This menu item is not removed by changing the Admin menu 😆 If the decision is to opt-in to the stylebook, then the theme support needs to be registered so that it is available in the Site Editor. Then the entire Stylebook can be shown conditionally. |
I am closing this in favour of #69043 |
What?
This PR changes how classic themes can opt-in to show the stylebook under the menu Appearance > Design.
Previously the stylebook was shown when the theme included
add_theme_support( 'editor-styles' );
The PR replaces the check for
editor-style
s withcurrent_theme_supports( 'editor', 'stylebook' )
What this does not do:
The PR does not offer a way to disable the style book for classic themes that add theme.json.
To do: Figure out what to do about the direct path to the stylebook
wp-admin/site-editor.php?p=%2Fstylebook
Partial for #68036
Why?
editor-styles
without the stylebook. A use case would be when the developer has created its own style guide.The new
editor
theme support can be extended later, as an alias for existing theme support related to the Site Editor, and for new features.How?
The PR replaces the check for
editor-styles
withcurrent_theme_supports( 'editor', 'stylebook' )
Testing Instructions
There should be no change for block themes and hybrid themes:
classic themes with theme.json
classic themes with templatest/index.html
Activating a classic theme should not enable the Design menu unless the theme support is added.
To add the theme support, copy paste the following into the theme setup function, usually in functions.php:
After it is added, the design menu item with the nested Patterns and Styles pages should be available.
The Pattern menu item should not be showing directly under Appearance.