Accordion Panel: Remove unnecessary wrapper div and simplify save #71454
Accordion Panel: Remove unnecessary wrapper div and simplify save #71454t-hamano merged 3 commits intoWordPress:trunkfrom
Conversation
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
t-hamano
left a comment
There was a problem hiding this comment.
Thanks for the PR! Can you update the Edit component as well as the save function?
78d584b to
dacc60f
Compare
What?
Closes #71436
Removes the unnecessary
accordion-content__wrapperdiv from the Accordion Panel block and simplifies the edit and save function.Why?
The Accordion Panel block was generating redundant HTML markup with an extra wrapper div that served no functional purpose. There was also some complexity with the save function, with manual styling extraction.
How?
Replaced manual styling extraction with the standard
useBlockProps.save()pattern that automatically handles all declared block supports (color, spacing, border, typography, shadow).Testing Instructions
Screencasts
Before
Screen.Recording.2025-09-01.at.23.27.38.mp4
After
Screen.Recording.2025-09-01.at.23.22.28.mp4