-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Allow heading and button in Pattern Overrides #57789
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,6 @@ export const PATTERN_SYNC_TYPES = { | |
// TODO: This should not be hardcoded. Maybe there should be a config and/or an UI. | ||
export const PARTIAL_SYNCING_SUPPORTED_BLOCKS = { | ||
'core/paragraph': { content: __( 'Content' ) }, | ||
'core/heading': { content: __( 'Content' ) }, | ||
'core/button': { text: __( 'Text' ) }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should it also support the URL? It is editable in the UI, but doesn't work at the moment, possibly because it's missing here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same with the various URL connected attributes such as rel, opening in a new tab etc. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I was thinking about that too. It's something that block bindings would need to support as well: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I am not mistaken, the URL of the button should work as well. It was included in the first pull request: link. Adding most attributes should be as easy as adding them to the relevant array, so we can try to add anything you consider relevant. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great, let's try adding them in a follow-up PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
It looks like this global variable will be removed in #57742, so if this PR ships first, it might be nice to help update #57742.
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.
Now it fails in trunk
Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given in /plugins/gutenberg/lib/block-supports/pattern.php:17
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.
Fixed by #57912. I did leave a note on #57742 to say that it needs to be rebased and #57912 merged first, but I don't think the person that merged it saw that.
Guess I should've been a bit noisier 😄
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.
I just saw it 😅 I didn't realize that #57742 would break trunk once this one is merged. Thanks for the patch @talldan!
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.
No worries @michalczaplinski! Thanks for approving and merging that PR, good to get it across the line!