-
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
Pattern block: Add slug as classname to pattern block wrapper #50641
Conversation
Size Change: +17 B (0%) Total Size: 1.39 MB
ℹ️ View Unchanged
|
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 fixing this up 👍
The pattern's class is now added correctly in the editor and matches the class on the pattern's wrapper in the front end.
🚢
@glendaviesnz or anyone else here, would you mind sharing a link to learn how to use the feature mentioned in this PR? I'm interested in "allow targeting of theme.json styles to a pattern". I haven't found any reference in developer.wordpress.org: |
This is still very much an experimental work in progress so is not available to use yet. If you keep an eye on the https://make.wordpress.org/core/ blog something will be announced there once the changes to patterns are completed and available to use. |
What?
Adds the pattern slug as a classname to block wrapper in the editor.
Why?
The slug is added to the wrapper in the frontend currently in order to allow targeting of theme.json styles to a pattern, but it is not added in the editor.
How?
Added via blockprops
Testing Instructions
<!-- wp:pattern {"slug":"twentytwentythree/cta","syncStatus":"partial"} /-->
to code editor and switch to visual editortwentytwentythree-cta
classname is added to the block wrapperScreenshots or screencast