Skip to content

[MOOSE-398] FE: has-balanced-text class not applying to FE Paragraph blocks#359

Merged
GeoffDusome merged 2 commits into
mainfrom
bug/MOOSE-398/fix-balanced-text
May 29, 2026
Merged

[MOOSE-398] FE: has-balanced-text class not applying to FE Paragraph blocks#359
GeoffDusome merged 2 commits into
mainfrom
bug/MOOSE-398/fix-balanced-text

Conversation

@GeoffDusome
Copy link
Copy Markdown
Contributor

@GeoffDusome GeoffDusome commented May 22, 2026

What does this do/fix?

This pull request improves the handling of custom controls and class names for WordPress core blocks in the create-wp-controls.js utility. The main focus is on ensuring that custom classes and attributes are correctly applied to both API v2 and v3 core blocks, addressing a previous issue where class names were not properly set on v3 blocks. The implementation is now more robust, modular, and supports multiple control configurations.

Core block controls and class name handling:

  • Refactored the settings/configuration system to support multiple registered control configs (configs array) and dynamic lookup for each block, replacing the previous single state.settings approach.
  • Added a new mechanism (applySaveElementClasses) to ensure managed classes are applied to the saved block element for all block API versions, fixing the issue where v3 core blocks did not get the correct class names. [1] [2]
  • Introduced helpers (normalizeClassSource, getBaseClassName) to robustly merge and normalize class sources from various attributes and props, ensuring consistent class name application.

Block attribute and control management:

  • Enhanced the initialization (init) to support multiple configs, re-register block types with merged custom attributes, and ensure filters are only registered once.
  • Improved default value assignment for custom controls using useEffect in the editor, ensuring attributes are set only when undefined.

These changes collectively provide better support for custom block controls and styling, especially for modern (API v3) core blocks, and resolve previous issues with class name application.

QA

Links to relevant issues

Test Environment

Pull request checklist

  • I've added a changelog entry for these changes.
  • I've linked to a relevant Jira issue.
  • I've captured a screenshot or screencast of the changes and linked it above. N/A

Copy link
Copy Markdown
Collaborator

@dpellenwood dpellenwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍏

@GeoffDusome GeoffDusome added In QA Waiting on QA and removed Needs FE Review labels May 28, 2026
@GeoffDusome GeoffDusome merged commit 63a1bf1 into main May 29, 2026
7 checks passed
@GeoffDusome GeoffDusome deleted the bug/MOOSE-398/fix-balanced-text branch May 29, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

In QA Waiting on QA Launch Environment Deploys to dokku

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants