feat(byline): add byline block support to patterns and templates#399
feat(byline): add byline block support to patterns and templates#399rbcorrales merged 5 commits intotrunkfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for the new newspack/byline block to all post-meta patterns, establishing a clear priority order for author display blocks.
Changes:
- Updated conditional logic in all post-meta patterns to prioritize
newspack/bylinewhen available - Maintained backward compatibility with Co-Authors Plus and core WordPress author blocks
- Added
newspack/avatarblock integration for patterns with avatar support
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| patterns/post-meta/post-meta-single-line.php | Added newspack/byline block as first priority for single-line author display |
| patterns/post-meta/post-meta-single-line-avatar.php | Added newspack/byline and newspack/avatar blocks for single-line layout with avatar |
| patterns/post-meta/post-meta-multiple-lines.php | Added newspack/byline block as first priority for multi-line author display |
| patterns/post-meta/post-meta-multiple-lines-avatar.php | Added newspack/byline and newspack/avatar blocks in two locations for multi-line layout with avatar |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I think it's safe to remove CAP from the equation here. |
|
Updated the default style of the block via theme.json 5395ebf |
laurelfulford
left a comment
There was a problem hiding this comment.
I agree with @thomasguillot that we can ditch any of the Co-Authors Plus code with this change 🙂
It looks like we need to update the block in a few more spots:
- archive.html
- author.html
- home.html
- search.html
I think these were just missed/skipped because they also didn't have the Co-Authors logic... or any logic because they're just HTML.
I think we should be able to swap the byline and date in these files with <!-- wp:pattern {"slug":"newspack-block-theme/post-meta-multiple-lines"} /--> (@thomasguillot unless there's a reason I'm forgetting why we didn't use patterns for these? 😅)
@laurelfulford Good call on updating these templates! But before I proceed, a quick clarification. The current templates (archive, author, home, search) use a compact layout with just byline + date (no sharing buttons, x-small font): <div class="wp-block-group post-meta">
<!-- wp:post-author {"showAvatar":false,"byline":"By","isLink":true,"fontSize":"x-small"} /-->
<!-- wp:post-date {"fontSize":"x-small"} /-->
</div>But the Should I use it anyway (adds sharing buttons to these pages) or create a new Also confirming I removed the CAP fallback from all patterns as you and @thomasguillot suggested: 9ab612c |
The CAP fallback is embedded inside the newspack byline block, that takes CAP into consideration in it. I think it makes sense to remove it from here. |
@rbcorrales Whoops! I tried adding the pattern in the editor but because I don't have Share buttons on, I didn't see this 🤦♀️ I need to get everything turned on on my block theme testing site. I think making a new pattern is the easiest way to move this forward! We might want to revisit the whole post meta pattern set to see if there's something we can do to reduce duplication (like can we consolidate the byline logic into one pattern that's shared?), but I don't think there's much point doing that until we know we're not going to be making more big changes to this area. |
|
@laurelfulford Thanks for confirming. I added the new pattern here: 72b83bd. Not particularly attached to the "compact" name, so feel free to suggest a better name if you have one in mind. Naming things is hard 😄. Also noticed the |
laurelfulford
left a comment
There was a problem hiding this comment.
Looks good - thanks @rbcorrales!
Not particularly attached to the "compact" name, so feel free to suggest a better name if you have one in mind. Naming things is hard
Naming things is impossible - I'm good with 'compact'! 🙂
Also noticed the Block Types headers were missing the Newspack blocks. Added: ede55f9.
Good catch! 🙌
* chore(deps-dev): bump dealerdirect/phpcodesniffer-composer-installer Bumps [dealerdirect/phpcodesniffer-composer-installer](https://github.com/PHPCSStandards/composer-installer) from 1.1.2 to 1.2.0. - [Release notes](https://github.com/PHPCSStandards/composer-installer/releases) - [Changelog](https://github.com/PHPCSStandards/composer-installer/blob/main/CHANGELOG.md) - [Commits](PHPCSStandards/composer-installer@v1.1.2...v1.2.0) --- updated-dependencies: - dependency-name: dealerdirect/phpcodesniffer-composer-installer dependency-version: 1.2.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump wp-coding-standards/wpcs from 3.2.0 to 3.3.0 Bumps [wp-coding-standards/wpcs](https://github.com/WordPress/WordPress-Coding-Standards) from 3.2.0 to 3.3.0. - [Release notes](https://github.com/WordPress/WordPress-Coding-Standards/releases) - [Changelog](https://github.com/WordPress/WordPress-Coding-Standards/blob/develop/CHANGELOG.md) - [Commits](WordPress/WordPress-Coding-Standards@3.2.0...3.3.0) --- updated-dependencies: - dependency-name: wp-coding-standards/wpcs dependency-version: 3.3.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * chore: update translation files [skip ci] * feat(byline): add byline block support to patterns and templates (#399) * chore: update translation files [skip ci] --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: matticbot <> Co-authored-by: Ramon Corrales <rbcorrales@users.noreply.github.com>
# [1.23.0](v1.22.0...v1.23.0) (2026-02-02) ### Features * **byline:** add byline block support to patterns and templates ([#399](#399)) ([c0d8a90](c0d8a90))
|
🎉 This PR is included in version 1.23.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
Updates post-meta patterns to prioritize the new
newspack/bylineblock when available.Pattern priority order:
newspack/byline- when Newspack plugin is activeco-authors-plus/coauthors- when CAP is active without Newspackcore/post-author- fallbackThis enables custom bylines and unified author display in block theme templates.
Requires: Automattic/newspack-plugin#4405
Closes # NPPD-1122.
Feedback requested: Should we keep the CAP fallback? The block theme is typically used with Newspack, so the
elseifforco-authors-plus/coauthorsmay be unnecessary. We could simplify to justnewspack/byline>core/post-author. Thoughts?How to test the changes in this Pull Request:
newspack-block-themewith Newspack plugin (byline block branch).newspack/bylineblock.Other information: