Global Styles: Lift classic block restrictions#10623
Global Styles: Lift classic block restrictions#10623youknowriad wants to merge 6 commits intoWordPress:trunkfrom
Conversation
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
5127b85 to
c1ea2a2
Compare
| '__unstableType' => 'user', | ||
| 'isGlobalStyles' => false, | ||
| ); | ||
|
|
There was a problem hiding this comment.
After the build change this will be duplicated between here and gutenberg block editor settings. We might have to move things around a bit in Gutenberg so gutenberg_get_block_editor_settings doesn't end up being used in Core, or else we define Gutenberg as the source of truth for this and remove it from Core.
There was a problem hiding this comment.
Yes, this could be an improvement at some point, but the change of build tool doesn't really impact this much outside making it easier to unify more things.
ramonjd
left a comment
There was a problem hiding this comment.
Generally LGTM
I'm not familiar with the work behind this so take my comments with as much salt as you can handle
| $tree = WP_Theme_JSON_Resolver::resolve_theme_file_uris( WP_Theme_JSON_Resolver::get_merged_data() ); | ||
|
|
||
| if ( empty( $types ) && ! $supports_theme_json ) { | ||
| $types = array( 'variables', 'presets', 'base-layout-styles' ); |
There was a problem hiding this comment.
Just checking that things will still work for anyone using the deprecated 'base-layout-styles' type?
Would a backwards compat test in pThemeJson.php be appropriate?
| * theme, the extra condition for whether $theme is the active theme is | ||
| * present here. | ||
| */ | ||
| if ( $theme->get_stylesheet() === get_stylesheet() && ! wp_theme_has_theme_json() ) { |
There was a problem hiding this comment.
So now we query for all themes (active or inactive, classic or block), not just themes with theme.json support?
Is the $theme->get_stylesheet() === get_stylesheet() no longer valid? Or will the terms ($theme->get_stylesheet()) below be empty?
There was a problem hiding this comment.
Yeah, I think the first part of the condition was unnecessary, we're explicitly passing a theme. I don't see why this particular function would need to only work for the current theme.
1d25062 to
e0c7362
Compare
Restore historical @SInCE annotations that were removed and add new 7.0.0 annotations documenting the deprecation of 'base-layout-styles' type and the addition of the new `base_layout_styles` option for classic themes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Change the Fonts submenu index from 8 to 9 to avoid collision with the Widgets menu, which also uses index 8 for classic themes in wp_widgets_add_menu(). Since the widgets menu is registered later via the _admin_menu hook, it was overwriting the Fonts entry. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
This commit breaks a couple things:
See Trac comment and repro steps. |

Backports changes from WordPress/gutenberg#73971 to lift Global Styles restrictions in classic themes. For more details check the upstream PR.
Trac ticket: https://core.trac.wordpress.org/ticket/64408