-
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
Rename button block attributes from url and text to href and content #62612
Rename button block attributes from url and text to href and content #62612
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/compat/wordpress-6.5/blocks.php ❔ lib/compat/wordpress-6.6/blocks.php |
Size Change: +304 B (+0.02%) Total Size: 1.76 MB
ℹ️ View Unchanged
|
One issue is that the block bindings code in the gutenberg plugin doesn't execute when the core class is present:
So that means the e2e tests for block bindings that are failing in this PR won't pass unless this change is backported. Feels like those e2e tests should be moved to wordpress core instead if they're testing core functionality. |
Closing based on feedback in #62133. |
What?
This is an attempt to solve #62133 by renaming the button block's attributes to be consistent with other blocks.
Mostly an exploration to see what it would entail (it turns out a lot of code changes, but it didn't take too long).
Why?
With block bindings and pattern overrides, the block's attributes are forming more of a schema. As described in the issue, with pattern overrides, attribute values can be shared across blocks with different types, and the values are accessed using the attribute name. When the attribute names are inconsistent for the content types they represent (like the
url
attribute name representing thesrc
attribute in the image block but also thehref
attribute for a button block), it causes unexpected issues (the imagesrc
ending up as the button block'shref
or vice versa).How?
Rename the attributes to make these attribute schemas consistent across block types.
Testing Instructions
TBD
Screenshots or screencast