Skip to content

Conversation

@GeoffDusome
Copy link
Contributor

What does this do/fix?

Note that this was a filter previously introduced & removed from Moose. WP at some point was supporting paragraph blocks having the wp-block-paragraph class, but no longer are, so we need to add this support so some of our related styling can also function as intended.


This pull request introduces a new filter to ensure that the core/paragraph block always includes its default CSS class name, improving styling consistency. The implementation uses a reusable trait to add the class name, and registers the new filter in the block definitions.

New Paragraph Block Filter:

  • Added a new Paragraph_Filter class that ensures the core/paragraph block always includes its default CSS class by using a shared trait. (wp-content/plugins/core/src/Blocks/Filters/Paragraph_Filter.php)

  • Registered the new Paragraph_Filter in the block filters array, so it is applied automatically. (wp-content/plugins/core/src/Blocks/Blocks_Definer.php) [1] [2]

Reusable Trait for Adding Default Class Name:

  • Introduced the Add_Block_Default_Class_Name trait, which adds the wp-block-<block name> CSS class to blocks that do not render it by default. This serves as a polyfill until WordPress core provides this functionality. (wp-content/plugins/core/src/Blocks/Filters/Traits/Add_Block_Default_Class_Name.php)

QA

Links to relevant issues

@GeoffDusome GeoffDusome added the Launch Environment Deploys to dokku label Dec 31, 2025
Copy link
Contributor

@Vinsanity Vinsanity 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 Jan 5, 2026
Copy link
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.

📗 [sigh]

@GeoffDusome GeoffDusome merged commit b7a12a6 into main Jan 9, 2026
7 checks passed
@GeoffDusome GeoffDusome deleted the fix/paragraph-block-class branch January 9, 2026 19:05
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.

4 participants