-
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
Support linkTarget
of core/button
for Pattern Overrides
#57947
Conversation
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/block-supports/pattern.php ❔ lib/experimental/block-bindings/class-wp-block-bindings.php ❔ lib/experimental/block-bindings/sources/pattern.php ❔ lib/experimental/blocks.php |
Size Change: +37 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
7f6ac08
to
c34e1ad
Compare
Superseded by #58587. |
What?
Part of #53705.
Support the
linkTarget
attribute of the button block for Pattern Overrides. Currently, the attribute relies onundefined
to represent "no target". We need a way to representundefined
values for attributes to be able to override the pattern.Why?
Because you can edit link target when editing the URL of the button block but it was never saved to the pattern instance.
How?
Use a special flag
WP_Block_Bindings::SKIP
on the server side to represent skipping the processing of the attribute instead of usingnull
. This also means we're treatingundefined
(unset) andnull
as the same value for attributes. This might not always be true for third-party blocks though. If this doesn't work then we'll look for other alternatives.Testing Instructions
Follow the instructions in #53705 (comment) to create a pattern with overrides.
linkTarget
attribute. (This could become a backward-compat concern that we'll need to deal with in a follow-up task.)Screenshots or screencast
TBD