-
Notifications
You must be signed in to change notification settings - Fork 7
fix(content-distribution): Image block lightbox and Jetpack carousel support #285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 adds core lightbox and Jetpack carousel support for distributed posts by enriching the media payload with additional metadata and implementing custom rendering filters on incoming posts. The changes also refactor block processor functionality into a dedicated Blocks class structure for better organization.
- Refactors block processing logic from
Content_Distributionclass into newBlocksandBlock_Processorclasses - Adds
Image_Blockclass to handle lightbox rendering and image attribute filtering for incoming posts - Enriches outgoing post media data with metadata, srcset, dimensions, title, and description fields
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
includes/content-distribution/blocks/class-blocks.php |
New class managing block processor registration and processing for outgoing/incoming blocks |
includes/content-distribution/blocks/class-block-processor.php |
New class encapsulating individual block processor logic with callbacks |
includes/content-distribution/blocks/class-image-block.php |
New class implementing custom lightbox rendering and image attribute filtering for distributed posts |
includes/content-distribution/class-outgoing-post.php |
Enhanced media data collection with additional metadata fields (srcset, dimensions, title, description) |
includes/content-distribution/class-incoming-post.php |
Updated to use refactored Blocks::process_incoming_block() method |
includes/class-content-distribution.php |
Refactored to remove block processor methods and delegate to new Blocks class |
tests/unit-tests/content-distribution/test-block-processor.php |
Updated test references from Content_Distribution to Blocks class |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
leogermani
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works!
|
Hey @miguelpeixe, 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! ❤️ |
## [2.18.2-alpha.1](v2.18.1...v2.18.2-alpha.1) (2026-01-09) ### Bug Fixes * **content-distribution:** Image block lightbox and Jetpack carousel support ([#285](#285)) ([90a85ac](90a85ac))
|
🎉 This PR is included in version 2.18.2-alpha.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
## [2.18.2](v2.18.1...v2.18.2) (2026-01-19) ### Bug Fixes * **content-distribution:** Image block lightbox and Jetpack carousel support ([#285](#285)) ([90a85ac](90a85ac))
|
🎉 This PR is included in version 2.18.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
NPPM-2398
This PR adds core lightbox and Jetpack's full-screen carousel support to incoming posts.
There's an existing bug that occurs when a distributed post image ID matches an existing image in the destination media library, causing the lightbox and carousel libraries to fetch the local image as the "larger" version.
The standard behavior when the attachment doesn't match anything locally is to render the URL from the markup, which is usually low resolution.
The proposed strategy is to set the expected attributes via filters. The libraries will read from them to render the original URL in high resolution.
Note: This PR also moves the block-specific functionality to a separate class, so it's no longer part of the main Content Distribution class.
How to test the changes in this Pull Request:
srcsetand several other attributes in comparison to the original post markupOther information: