Skip to content

fix: iframe editor compatiblity#4444

Merged
chickenn00dle merged 7 commits into
trunkfrom
fix/iframe-editor-compatibility
Feb 24, 2026
Merged

fix: iframe editor compatiblity#4444
chickenn00dle merged 7 commits into
trunkfrom
fix/iframe-editor-compatibility

Conversation

@chickenn00dle
Copy link
Copy Markdown
Contributor

@chickenn00dle chickenn00dle commented Feb 2, 2026

All Submissions:

Changes proposed in this Pull Request:

Closes https://linear.app/a8c/issue/NPPM-2582/newspack-plugin-iframe-editor-compatibility

This PR ensures all of the custom blocks registered in the main Plugin work in the iframe editor.

How to test the changes in this Pull Request:

  1. Ensure ONLY the main plugin, blocks, newsletters, and popups are the only Newspack extensions active and are all on the fix/iframe-editor-compatibility branch.
  2. Smoke test blocks in the editor + frontend (You can find a list in the linked linear issue)

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?

@chickenn00dle chickenn00dle force-pushed the fix/iframe-editor-compatibility branch from adde8ee to 9aca367 Compare February 4, 2026 17:55
@chickenn00dle chickenn00dle marked this pull request as ready for review February 4, 2026 20:10
Copilot AI review requested due to automatic review settings February 4, 2026 20:10
@chickenn00dle chickenn00dle requested a review from a team as a code owner February 4, 2026 20:10
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

This PR updates Newspack blocks to be compatible with WordPress's iframe editor by upgrading blocks to apiVersion 3 and implementing proper useBlockProps patterns. The iframe editor was introduced in WordPress 6.3+ and requires blocks to follow updated rendering patterns for proper functionality.

Changes:

  • Upgraded four blocks (reader-registration, correction-item, correction-box, avatar) to apiVersion 3
  • Added useBlockProps wrappers to edit components for proper iframe editor support
  • Changed enqueue hook from enqueue_block_editor_assets to enqueue_block_assets for better iframe editor asset loading

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/blocks/reader-registration/block.json Updated apiVersion from 2 to 3 for iframe editor compatibility
src/blocks/correction-item/block.json Added $schema and apiVersion 3
src/blocks/correction-box/block.json Added $schema and apiVersion 3
src/blocks/correction-box/edit.jsx Added useBlockProps import and wrapped JSX in div with blockProps
src/blocks/avatar/block.json Added $schema and apiVersion 3, fixed trailing newline
src/blocks/avatar/edit.jsx Wrapped JSX in div with blockProps instead of Fragment
includes/class-newspack-ui.php Changed hook from enqueue_block_editor_assets to enqueue_block_assets

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

Comment thread src/blocks/avatar/edit.jsx Outdated
Comment thread src/blocks/correction-box/edit.jsx Outdated
Comment thread src/blocks/correction-box/edit.jsx Outdated
Comment thread includes/class-newspack-ui.php Outdated
@chickenn00dle chickenn00dle added the [Status] Needs Review The issue or pull request needs to be reviewed label Feb 4, 2026
@chickenn00dle chickenn00dle changed the title chore: iframe editor compatiblity fix: iframe editor compatiblity Feb 9, 2026
@chickenn00dle chickenn00dle force-pushed the fix/iframe-editor-compatibility branch from f6b2e2f to 472dbaf Compare February 10, 2026 14:15
@chickenn00dle chickenn00dle force-pushed the fix/iframe-editor-compatibility branch from 472dbaf to d83f5c1 Compare February 10, 2026 21:31
@chickenn00dle chickenn00dle force-pushed the fix/iframe-editor-compatibility branch from d83f5c1 to ed4258a Compare February 10, 2026 22:06
*/
public static function handle_old_nicename_meta( $user_id, $old_nicename, $new_nicename ) {
$old_nicename_meta = (array) get_user_meta( $user_id, self::OLD_NICENAME_META_KEY );
$old_nicename_meta = (array) get_user_meta( $user_id, self::OLD_NICENAME_META_KEY, false );
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Unrelated, but fixed the php lint warning.

*/
public function get_post_revisions() {
$ids = get_post_meta( $this->post_id, self::MAJOR_IDS_META_KEY );
$ids = get_post_meta( $this->post_id, self::MAJOR_IDS_META_KEY, false );
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Unrelated, but fixes a php lint warning

@github-actions github-actions Bot added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed labels Feb 24, 2026
@chickenn00dle chickenn00dle merged commit 12dfaba into trunk Feb 24, 2026
13 checks passed
@chickenn00dle chickenn00dle deleted the fix/iframe-editor-compatibility branch February 24, 2026 20:56
@github-actions
Copy link
Copy Markdown

Hey @chickenn00dle, good job getting this PR merged! 🎉

Now, the needs-changelog label has been added to it.

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! ❤️

matticbot pushed a commit that referenced this pull request Mar 5, 2026
# [6.35.0-alpha.1](v6.34.2...v6.35.0-alpha.1) (2026-03-05)

### Bug Fixes

* allow deletion of payment method for Braintree ([63ceec3](63ceec3))
* apply Copilot suggestion for tests ([6133636](6133636))
* **avatar:** correct duotone selector to support custom colors ([#4513](#4513)) ([c4458d4](c4458d4))
* **byline:** update placeholder text to "Author Name" ([#4510](#4510)) ([727b1e8](727b1e8))
* **co-authors-plus:** sanitize user_login before building dummy email… ([#4520](#4520)) ([32c2602](32c2602))
* do not depend on _get() to return an array ([2816470](2816470))
* **dropdown-menu:** avoid overflow at bottom of viewport ([#4495](#4495)) ([a5ce464](a5ce464))
* enable payment method deletion for Braintree ([c50f094](c50f094))
* iframe editor compatiblity ([#4444](#4444)) ([12dfaba](12dfaba))
* **my-account:** don't show subscription payment notice in modal checkout ([#4500](#4500)) ([2cb3324](2cb3324))
* **my-account:** force white background color ([#4514](#4514)) ([02e2555](02e2555))
* **my-account:** resubscription validation in order-again template ([#4498](#4498)) ([36871fc](36871fc))
* **newspack-icon:** background color ([#4516](#4516)) ([8c5dc9c](8c5dc9c))
* **newspack-ui:** remove overflow when modal is open ([#4515](#4515)) ([0b2cbd3](0b2cbd3))
* prune read-only keys from sync queue ([bf81734](bf81734))
* remove unused 'edit' and 'save' actions from Braintree payment methods ([8f72a8d](8f72a8d))
* **snackbar:** autohide progress bar not always appearing ([#4504](#4504)) ([4eda60f](4eda60f))

### Features

*  identify and enforce read-only items for Reader Data Library ([4f2ef8a](4f2ef8a))
* add featured image caption block ([#4519](#4519)) ([0b744ff](0b744ff))
* **author-profile:** avatar and social blocks for nested author profile ([#4448](#4448)) ([cff670b](cff670b))
* **content-gate:** comment restriction with metering support ([#4529](#4529)) ([714c8b7](714c8b7))
* **content-gate:** per-post access control exemption ([#4530](#4530)) ([636679b](636679b))
* **content-gate:** user access information ([#4542](#4542)) ([b49347e](b49347e))
* **content-gating:** group subscription invitations data structure + admin UI ([#4536](#4536)) ([e609e83](e609e83))
* **content-gating:** i3 designs for content gates list view ([#4512](#4512)) ([dcbb239](dcbb239))
* **corrections:** append corrections to Republication Tracker Tool content ([#4501](#4501)) ([71bd177](71bd177))
* data event handler registration and dispatching to integrations ([#4481](#4481)) ([7c79da6](7c79da6))
* **data-events:** add ActionScheduler logging and retry reason ([#4488](#4488)) ([e8af964](e8af964))
* **integrations:** make sure contact data is read from persistent data ([#4505](#4505)) ([c2ee26a](c2ee26a))
* **integrations:** start get fields abstraction and pull contact data ([#4470](#4470)) ([8ddcf23](8ddcf23)), closes [#4477](#4477)
* **reader-registration-block:** password, OTP, and verification flows ([#4452](#4452)) ([fc4567e](fc4567e))
* reject changes to specific reader data keys ([fe52e12](fe52e12))
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 5, 2026

🎉 This PR is included in version 6.35.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Mar 16, 2026
# [6.35.0](v6.34.4...v6.35.0) (2026-03-16)

### Bug Fixes

* allow deletion of payment method for Braintree ([63ceec3](63ceec3))
* apply Copilot suggestion for tests ([6133636](6133636))
* **avatar:** correct duotone selector to support custom colors ([#4513](#4513)) ([c4458d4](c4458d4))
* **byline:** update placeholder text to "Author Name" ([#4510](#4510)) ([727b1e8](727b1e8))
* **co-authors-plus:** sanitize user_login before building dummy email… ([#4520](#4520)) ([32c2602](32c2602))
* do not depend on _get() to return an array ([2816470](2816470))
* **dropdown-menu:** avoid overflow at bottom of viewport ([#4495](#4495)) ([a5ce464](a5ce464))
* enable payment method deletion for Braintree ([c50f094](c50f094))
* iframe editor compatiblity ([#4444](#4444)) ([12dfaba](12dfaba))
* **my-account:** don't show subscription payment notice in modal checkout ([#4500](#4500)) ([2cb3324](2cb3324))
* **my-account:** force white background color ([#4514](#4514)) ([02e2555](02e2555))
* **my-account:** resubscription validation in order-again template ([#4498](#4498)) ([36871fc](36871fc))
* **newspack-icon:** background color ([#4516](#4516)) ([8c5dc9c](8c5dc9c))
* **newspack-ui:** remove overflow when modal is open ([#4515](#4515)) ([0b2cbd3](0b2cbd3))
* prune read-only keys from sync queue ([bf81734](bf81734))
* remove unused 'edit' and 'save' actions from Braintree payment methods ([8f72a8d](8f72a8d))
* **snackbar:** autohide progress bar not always appearing ([#4504](#4504)) ([4eda60f](4eda60f))

### Features

*  identify and enforce read-only items for Reader Data Library ([4f2ef8a](4f2ef8a))
* add featured image caption block ([#4519](#4519)) ([0b744ff](0b744ff))
* **author-profile:** avatar and social blocks for nested author profile ([#4448](#4448)) ([cff670b](cff670b))
* **content-gate:** comment restriction with metering support ([#4529](#4529)) ([714c8b7](714c8b7))
* **content-gate:** per-post access control exemption ([#4530](#4530)) ([636679b](636679b))
* **content-gate:** user access information ([#4542](#4542)) ([b49347e](b49347e))
* **content-gating:** group subscription invitations data structure + admin UI ([#4536](#4536)) ([e609e83](e609e83))
* **content-gating:** i3 designs for content gates list view ([#4512](#4512)) ([dcbb239](dcbb239))
* **corrections:** append corrections to Republication Tracker Tool content ([#4501](#4501)) ([71bd177](71bd177))
* data event handler registration and dispatching to integrations ([#4481](#4481)) ([7c79da6](7c79da6))
* **data-events:** add ActionScheduler logging and retry reason ([#4488](#4488)) ([e8af964](e8af964))
* **integrations:** make sure contact data is read from persistent data ([#4505](#4505)) ([c2ee26a](c2ee26a))
* **integrations:** start get fields abstraction and pull contact data ([#4470](#4470)) ([8ddcf23](8ddcf23)), closes [#4477](#4477)
* **reader-registration-block:** password, OTP, and verification flows ([#4452](#4452)) ([fc4567e](fc4567e))
* reject changes to specific reader data keys ([fe52e12](fe52e12))
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 6.35.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

[Status] Approved The pull request has been reviewed and is ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants