-
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
Fix for current_parsed_blocks value when block has inner blocks #26291
Conversation
Size Change: 0 B Total Size: 1.2 MB ℹ️ View Unchanged
|
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.
Tested this out and works as expected. 👍
The change makes sense, make sure the global has the right value before render and replace it with the previous value after.
cc @tellthemachines we need this (or an alternative that fixes the bug) for the release. Flagging in case I'm not around when that happens. |
f9ce774
to
519a496
Compare
I think the change is solid, but there's a couple of things I don't know how to do:
It's a bit late over here so I'll leave the PR unmerged so others can chime in. |
@nosolosw I believe the process is to open a core ticket with the diff. I created a ticket and diff here: https://core.trac.wordpress.org/ticket/51569 |
Thanks for flagging, Fabian. I see there's a core ticket https://core.trac.wordpress.org/ticket/51612 for this as well as a potential solution at WordPress/wordpress-develop#691 |
In #26192 we refactored the block supports mechanism. It works by holding a global
$current_parsed_blocks
reference that it uses to determine the attributes that it needs to add to blocks.However, when a block has inner blocks, that reference isn't updated so inner blocks end up inheriting the parent's properties (style and classes).
How to test
This is what I've done:
wp-includes/class-wp-block.php
class with the contents of this PR.li
elements) don't have thewp-social-links
class attached. It should be present in the parent (ul
element).