fix: iframe Editor Compatibility#2025
Conversation
a02ca1b to
34e4bdd
Compare
There was a problem hiding this comment.
Pull request overview
This PR aims to improve Gutenberg iframe-based editor compatibility for Newspack Newsletters blocks by aligning block registration/assets with block.json + API v3 patterns and by switching editor asset enqueueing to a hook that runs inside the iframe.
Changes:
- Migrate the Share block to
block.jsonmetadata-based registration (apiVersion 3). - Update Posts Inserter editor wrapper to use
useBlockPropsand addblock.jsonschema/apiVersion. - Switch editor-related asset enqueues from
enqueue_block_editor_assetstoenqueue_block_assets(withis_admin()guards), and bump some blocks toapiVersion: 3.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/editor/blocks/share/index.js | Switches Share block registration to metadata/settings pattern using block.json. |
| src/editor/blocks/share/block.json | Adds Share block metadata/attributes/supports (apiVersion 3). |
| src/editor/blocks/posts-inserter/index.js | Uses useBlockProps + classnames for consistent wrapper props/classes. |
| src/editor/blocks/posts-inserter/block.json | Adds $schema and apiVersion: 3 to metadata. |
| src/editor/blocks/ad/block.json | Bumps block API version to 3. |
| src/blocks/subscribe/block.json | Bumps block API version to 3. |
| includes/class-newspack-newsletters-editor.php | Moves editor assets enqueue hook to enqueue_block_assets and renames method accordingly. |
| includes/class-newspack-newsletters-blocks.php | Moves blocks assets enqueue hook to enqueue_block_assets and renames method accordingly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hey @chickenn00dle, good job getting this PR merged! 🎉 Now, the Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label. If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label. Thank you! ❤️ |
# [3.29.0-alpha.1](v3.28.6...v3.29.0-alpha.1) (2026-03-05) ### Bug Fixes * iframe editor compatibility ([#2025](#2025)) ([cd15c02](cd15c02)) * improve error handling in upsert contact method ([#2031](#2031)) ([89a5937](89a5937)) * no parallel post-release jobs ([#2037](#2037)) ([8e4a738](8e4a738)) ### Features * **init-modal:** apply new modal style to init screen in editor ([#2041](#2041)) ([3caafdc](3caafdc))
|
🎉 This PR is included in version 3.29.0-alpha.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
Closes https://linear.app/a8c/issue/NPPM-2586/newspack-newsletters-iframe-editor-compatibility
How to test the changes in this Pull Request:
fix/iframe-editor-compatibilitybranch.Other information: