fix: update blocks for compatibility with iframe-based Post Editor#578
Draft
jason10lee wants to merge 8 commits intotrunkfrom
Draft
fix: update blocks for compatibility with iframe-based Post Editor#578jason10lee wants to merge 8 commits intotrunkfrom
jason10lee wants to merge 8 commits intotrunkfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates Newspack Listings blocks to be compatible with the iframe-based Post Editor by moving blocks to Block API v3 conventions and ensuring editor markup is properly wrapped.
Changes:
- Bump multiple blocks to
apiVersion: 3(block.json + JS registration) and update PHP registration where needed. - Add
useBlockProps()wrappers across block editors to ensure proper block wrapper markup in the iframe editor. - Adjust editor asset enqueueing to run via
enqueue_block_assetswith an editor-only guard.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
includes/class-blocks.php |
Enqueue editor assets via enqueue_block_assets and gate to editor contexts. |
src/blocks/curated-list/* |
Move to API v3 and ensure editor output uses useBlockProps wrapper(s). |
src/blocks/event-dates/* |
Move to API v3 and ensure editor output uses useBlockProps. |
src/blocks/list-container/* |
Move to API v3 and ensure editor output uses useBlockProps (including hidden wrapper behavior). |
src/blocks/listing/* |
Move to API v3 and ensure editor output is wrapped with useBlockProps. |
src/blocks/price/* |
Move to API v3; switch PHP registration to metadata (__DIR__) and wrap editor output with useBlockProps. |
src/blocks/self-serve-listings/* |
Move to API v3; switch PHP registration to metadata (__DIR__) and wrap editor output with useBlockProps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
This PR reworks several blocks in this plugin for compatibility with the new iframe-based Post Editor:
Addresses NPPM-2589: Newspack Listings (iframe Editor Compatibility).
How to test the changes in this Pull Request:
General Prerequisites:
newspack-pluginandnewspack-listingsenabled.Priceblock to at least one)<iframe>.Querylist.Specific Listingslist, and select a few listings you created using the+at the bottom.Experimental prerequisites: Self-serve listings (released as an experimental feature)
In addition to the above:
NEWSPACK_LISTINGS_SELF_SERVE_ENABLEDtotruehowever you like--for example, inwp-config.php:Single listings and subscriptionsto test the tabs.<iframe>.Testing standard blocks:
<iframe>in the DOM.Querylist.Specific Listingslist, and select a few listings you created using the+at the bottom.Testing self-serve listings form:
Single listings and subscriptionsto test the tabs.Testing existing blocks (the upgrade case):
Other information: