Skip to content

Global Styles: Lift classic block restrictions#10623

Closed
youknowriad wants to merge 6 commits intoWordPress:trunkfrom
youknowriad:update/lift-global-styles-restrictions
Closed

Global Styles: Lift classic block restrictions#10623
youknowriad wants to merge 6 commits intoWordPress:trunkfrom
youknowriad:update/lift-global-styles-restrictions

Conversation

@youknowriad
Copy link
Contributor

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

@youknowriad youknowriad self-assigned this Dec 12, 2025
@github-actions
Copy link

github-actions bot commented Dec 12, 2025

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 props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props youknowriad, isabel_brison, ramonopoly.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions
Copy link

Test using WordPress Playground

The 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

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

Copy link
Contributor

@tellthemachines tellthemachines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changeset LGTM overall! Might be good to rebase this so we can test it on top of the recent build changes. I tried spinning up the Playground test env but it's acting a bit flaky; there are two custom background menu items instead of the fonts one under "Appearance" 😅

Image

'__unstableType' => 'user',
'isGlobalStyles' => false,
);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

@ramonjd ramonjd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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' );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@youknowriad youknowriad force-pushed the update/lift-global-styles-restrictions branch from 1d25062 to e0c7362 Compare January 12, 2026 09:46
youknowriad and others added 2 commits January 12, 2026 10:50
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>
@github-actions
Copy link

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 61473
GitHub commit: fd2693d

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions bot closed this Jan 12, 2026
@youknowriad youknowriad deleted the update/lift-global-styles-restrictions branch January 12, 2026 12:21
@westonruter
Copy link
Member

This commit breaks a couple things:

  1. Live Preview in the Customizer
  2. The CSS cascade.

See Trac comment and repro steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants