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
Global Styles: Don't show "Apply Styles Globally" button in non-block based themes #56033
Conversation
Size Change: +22 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
This change makes sense to me, thanks for putting it forward. Could you recommend a hybrid theme to test it with? (with link) |
Ah never mind, I followed the tip over on the issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix @t-hamano 👍
✅ Could replicate issue on trunk
✅ Block themes still have the "Apply styles globally" button
✅ Classic/hybrid themes with add_theme_support( 'block-template-parts' )
no longer show the button
Not sure if it's the naive way in which I tested (I just added add_theme_support( 'block-template-parts' ); to a classic theme) but this change also avoids a store error that tries to resolve dirty state in the editor:
I might have been missing something obvious but I could only trigger this error when attempting to use the "apply styles globally" button on a non-block theme.
Thanks for the review, @ramonjd, @aaronrobertshaw!
Sorry, I was expecting that you could access Anyway, I would like to merge this PR👍 |
Thanks everyone. Looks great! |
Fixes #56007
What?
This PR will prevent the "Apply Styles Globally" button from being displayed in hybrid themes that support block template parts.
Why?
This is because non-block-based themes do not support global styles UI and there is no way to reset global styles once applied.
How?
Checks if the current theme is a block theme when the button is rendered.
Testing Instructions
http://localhost:8888/wp-admin
.