Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new custom block for displaying featured image captions with optional media credit information. The block integrates with the Newspack Image Credits plugin to automatically display caption and credit metadata, while also allowing users to override with custom caption text.
Changes:
- Added a new
newspack-block-theme/featured-image-captionblock with editor UI and server-side rendering - Integrated the block into all post and archive templates that display featured images
- Implemented support for automatic caption/credit display from media metadata with custom override capability
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| includes/blocks/featured-image-caption/class-featured-image-caption.php | PHP class for block registration and server-side rendering |
| includes/blocks/featured-image-caption/block.json | Block metadata and configuration |
| includes/blocks/featured-image-caption/edit.js | React component for block editor UI |
| includes/blocks/featured-image-caption/editor.js | Block registration entry point |
| includes/blocks/featured-image-caption/style.scss | Styles for placeholder text in editor |
| includes/blocks/index.php | Added require statement to load new block class |
| src/scss/blocks/_blocks.scss | Added import for block styles |
| templates/single/*.html | Added featured-image-caption block to all single post templates |
| templates/archive.html | Added featured-image-caption block to archive template |
| templates/author.html | Added featured-image-caption block to author template |
| templates/home.html | Added featured-image-caption block to home template |
| templates/search.html | Added featured-image-caption block to search template |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c175571 to
d78c2f4
Compare
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:
Closes https://linear.app/a8c/issue/NPPD-1187/captioncredit-block-for-featured-images
This PR adds a featured image caption block to the block theme and adds the block to every template which contains a featured image.
How to test the changes in this Pull Request:
Other information: