-
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
Patterns: Inject the theme name into the block attributes #54595
Conversation
…ern is loaded in the start template screen
Size Change: +9.95 kB (+1%) Total Size: 1.63 MB
ℹ️ View Unchanged
|
( select ) => select( coreStore ).getCurrentTheme().stylesheet | ||
); | ||
|
||
// Duplicated from packages/block-library/src/pattern/edit.js. |
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.
should we make a similar comment in that file so any future changes get ported to this function too?
yep, still happens to me without a symlink |
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.
Sorry, my environment wasn't working correctly, this works as expected, thank you for the fix
I tagged this for backport since we are going to need it for TT4 and it's best if it makes it to beta @mikachan |
* Patterns: Inject the theme name into the block attributes when a pattern is loaded in the start template screen * Add a comment to make it clear what code is duplicated
I just cherry-picked this PR to the release/16.7 branch to get it included in the next release: f452d03 |
What?
Inject the theme name into the block attributes when a pattern is loaded in the start template screen.
Why?
This means that themes can live in any directory and the templates will still work. Fix here: #53194
How?
Reusing the approach from #53423. We might want to refactor this so that these two instances use the same code, but I'm hesitant because I'm not sure we want to expose this as an API.
Testing Instructions
Screenshots or screencast