Repository navigation
Fix: Incorrect selector generated by append_to_selector method - #48759
Conversation
e518e06 to
e08279b
Compare
|
I believe this PR would change the performance measurements reported in this comment, but I wasn't sure how to test it. I would appreciate it if you could perform the performance measurement again 🙏 |
|
Flaky tests detected in e08279b. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4336234328
|
|
Backporting as of WordPress/wordpress-develop#4412 |
|
@oandregal I suggest we wait for this until #50266 to backport? Or is there any rush in backporting this now? |
|
It's fine to wait. I just wanted to have this linked somewhere. As a general practice, but also, we don't forget the proper attribution to |
Fixes: #48393
Fixes: #48706
Related to: #47833
What?
This PR fixes the problem that the
append_to_selector()method of theWP_Theme_JSON_Gutenbergclass does not generate the correct selector.Why?
In #47833, a process has been added to check if the selector contains a comma to avoid unwanted
implide/explode. However, the parameters of the str_contains function to check for it appears to be reversed.Testing Instructions
Confirm that the correct selector is generated in the two issues that this PR fixes.
Testing for #48393 (Button Block: Style for pseudo-elements has priority)
The pseudo-element selector should be correctly generated and the background color of the button should change to the expected color.
Before
After
Testing for #48706 (Heading in selectors aren't set correctly at the block level)
theme.jsonwith the code described in this comment.Before
After