Fixed block class name attribute handling - #3002
Open
girishpanchal30 wants to merge 1 commit into
Open
Conversation
Contributor
Bundle Size Diff
|
Contributor
|
Plugin build for b890d1a is ready 🛎️!
|
Contributor
E2E TestsPlaywright Test Status: See serial and parallel matrix jobs Performance ResultsserverResponse: {"q25":368.65,"q50":378.92,"q75":391.98,"cnt":10}, firstPaint: {"q25":1310.18,"q50":1375.26,"q75":1542.54,"cnt":10}, domContentLoaded: {"q25":3410.43,"q50":3418.81,"q75":3438.58,"cnt":10}, loaded: {"q25":3413.4,"q50":3421.62,"q75":3441.33,"cnt":10}, firstContentfulPaint: {"q25":2217.76,"q50":2575.96,"q75":2589.09,"cnt":10}, firstBlock: {"q25":16125.24,"q50":16325.79,"q75":16375.72,"cnt":10}, type: {"q25":24.54,"q50":27.69,"q75":31.92,"cnt":10}, typeWithoutInspector: {"q25":24.58,"q50":26.32,"q75":29.35,"cnt":10}, typeWithTopToolbar: {"q25":30.18,"q50":35.71,"q75":38.18,"cnt":10}, typeContainer: {"q25":14.46,"q50":15.52,"q75":17.18,"cnt":10}, focus: {"q25":123.09,"q50":125.52,"q75":134.45,"cnt":10}, inserterOpen: {"q25":39.86,"q50":43.65,"q75":45.1,"cnt":10}, inserterSearch: {"q25":27.44,"q50":28.78,"q75":30.3,"cnt":10}, inserterHover: {"q25":4.59,"q50":5.18,"q75":5.55,"cnt":20}, loadPatterns: {"q25":1678.86,"q50":1710.75,"q75":1799.02,"cnt":10}, listViewOpen: {"q25":215.62,"q50":227.51,"q75":228.37,"cnt":10} |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds safe normalization for array-valued block class names, preventing frontend rendering and asset-loading errors.
Changes:
- Introduces shared class-name normalization.
- Updates sticky, Font Awesome, animation, Posts Grid, and modal consumers.
- Adds regression tests and updates the standalone CSS sandbox.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
inc/class-registration.php |
Adds normalization and updates asset detection. |
inc/class-base-css.php |
Normalizes animation classes. |
inc/render/class-posts-grid-block.php |
Safely detects tiled layouts. |
inc/css/blocks/class-posts-css.php |
Safely evaluates tiled-style CSS. |
plugins/otter-pro/inc/render/class-modal-block.php |
Normalizes modal wrapper classes. |
tests/test-block-class-name.php |
Adds regression coverage. |
tests/php/foreign-sabberworm-sandbox.php |
Loads the new dependency. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Soare-Robert-Daniel
approved these changes
Aug 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2996
Summary
Handled the case when the
classNameattribute of a block is an array instead of a string. This can happen when third-party plugins modify the block attributes.Checklist before the final review