Skip to content

fix(block-theme): remove MJML image-caption filter moved to newsletters plugin#442

Open
chickenn00dle wants to merge 1 commit intotrunkfrom
fix/newsletter-editor-block-theme-adjustments
Open

fix(block-theme): remove MJML image-caption filter moved to newsletters plugin#442
chickenn00dle wants to merge 1 commit intotrunkfrom
fix/newsletter-editor-block-theme-adjustments

Conversation

@chickenn00dle
Copy link
Copy Markdown
Contributor

@chickenn00dle chickenn00dle commented Apr 14, 2026

All Submissions:

Changes proposed in this Pull Request:

The MJML image-caption component attributes filter (setting align=left and padding=0) was duplicated identically in both the block theme and classic theme. This code has been moved into the newsletters plugin renderer as a default in Automattic/newspack-newsletters#2078, so the duplicate in this theme is no longer needed.

Depends on Automattic/newspack-newsletters#2078

Addresses https://linear.app/a8c/issue/NPPD-1316

How to test the changes in this Pull Request:

  1. Apply fix(block-theme): override theme.json styles in the newsletter editor newspack-newsletters#2078 first
  2. Activate the Newspack Block Theme
  3. Create a Newsletter post with all of the non-RDB blocks (I decided not to tackle these here as this one is already quite hairy) listed in this comment
  4. Send a test email and verify the image caption is left-aligned with no extra padding — same as before this change

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

🤖 Generated with Claude Code

…rs plugin

The image-caption MJML component attributes filter is now applied as a
default in the newsletters plugin renderer, so the duplicate in the
theme is no longer needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@chickenn00dle chickenn00dle marked this pull request as ready for review April 15, 2026 17:33
@chickenn00dle chickenn00dle requested a review from a team as a code owner April 15, 2026 17:33
Copilot AI review requested due to automatic review settings April 15, 2026 17:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Removes a now-duplicated MJML image-caption component attributes filter from the block theme, based on the behavior being moved into the Newspack Newsletters plugin renderer.

Changes:

  • Stops registering the newspack_newsletters_mjml_component_attributes filter in the theme.
  • Removes the theme’s mjml_component_attributes() implementation that forced align=left and padding=0 for image-caption.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread includes/class-newspack-newsletters.php
@laurelfulford laurelfulford self-requested a review April 15, 2026 18:07
Copy link
Copy Markdown
Contributor

@laurelfulford laurelfulford left a comment

Choose a reason for hiding this comment

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

Looks good! Caption alignment still works with this PR + Automattic/newspack-newsletters#2078 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants