Backport: Elements - Merge element style and classname generation to single filter#6214
Conversation
|
This PR is still only in a draft state as I have run out of time. Unfortunately, I'll be AFK until next week with limited bandwidth to push this across the line. Anyone is welcome to pick this up, push to it, or create an alternate PR 🙏 |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
342eb52 to
7b64d09
Compare
tellthemachines
left a comment
There was a problem hiding this comment.
This is testing well for me! In order to reproduce the bug that this fixes, I dumped the filter that originally caused it in gutenberg into the layout.php file. I was then able to confirm that this change fixes the issue.
Just a couple minor corrections below, but otherwise looks good!
|
Thanks for the review @tellthemachines 👍 |
tellthemachines
left a comment
There was a problem hiding this comment.
Thanks for the update! LGTM.
|
Committed in r58074. |
| * `render_block_data` filter in 6.6.0 to avoid filtered attributes | ||
| * breaking the application of the elements CSS class. | ||
| * | ||
| * @see https://github.com/WordPress/gutenberg/pull/59535. |
| * @param array $block Block object. | ||
| * | ||
| * @return string Filtered block content. |
|
@mukeshpanchal27 as these changes were already committed, I've created a follow-up PR to address the issues noted |
Syncs the changes from WordPress/gutenberg#59535 and WordPress/gutenberg#59538.
These change update the elements block support filters such that the elements class name is only generated in a single location. This avoids conflicts between class names and makes the block support robust in the face of a block's data being filtered via other
render_block_datafilters.To test:
Confirm WordPress/gutenberg#59462 is still resolved
Create some nested blocks containing links
Unit tests:
Trac ticket: https://core.trac.wordpress.org/ticket/60681
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.