Skip to content

feat(byline): add byline block support to patterns and templates#399

Merged
rbcorrales merged 5 commits intotrunkfrom
feat/byline-block-patterns
Jan 21, 2026
Merged

feat(byline): add byline block support to patterns and templates#399
rbcorrales merged 5 commits intotrunkfrom
feat/byline-block-patterns

Conversation

@rbcorrales
Copy link
Member

All Submissions:

Changes proposed in this Pull Request:

Updates post-meta patterns to prioritize the new newspack/byline block when available.

Pattern priority order:

  1. newspack/byline - when Newspack plugin is active
  2. co-authors-plus/coauthors - when CAP is active without Newspack
  3. core/post-author - fallback

This 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 elseif for co-authors-plus/coauthors may be unnecessary. We could simplify to just newspack/byline > core/post-author. Thoughts?


How to test the changes in this Pull Request:

  1. Activate newspack-block-theme with Newspack plugin (byline block branch).
  2. View a single post and verify the author byline displays correctly.
  3. Check Site Editor > post-meta patterns should use newspack/byline block.
  4. Deactivate Newspack plugin > patterns should fall back to CAP or core/post-author.

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?

Copy link

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 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/byline when available
  • Maintained backward compatibility with Co-Authors Plus and core WordPress author blocks
  • Added newspack/avatar block 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.

@thomasguillot
Copy link
Contributor

I think it's safe to remove CAP from the equation here.

@thomasguillot
Copy link
Contributor

Updated the default style of the block via theme.json 5395ebf

Copy link
Contributor

@laurelfulford laurelfulford left a comment

Choose a reason for hiding this comment

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

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? 😅)

@rbcorrales
Copy link
Member Author

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"} /-->

@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 post-meta-multiple-lines pattern includes Jetpack sharing buttons and different spacing:

<!-- wp:pattern {"slug":"newspack-block-theme/jetpack-sharing-buttons"} /-->

Should I use it anyway (adds sharing buttons to these pages) or create a new post-meta-compact pattern that matches the current design?

Also confirming I removed the CAP fallback from all patterns as you and @thomasguillot suggested: 9ab612c

@leogermani
Copy link
Contributor

leogermani commented Jan 19, 2026

Should we keep the CAP fallback?

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.

@laurelfulford
Copy link
Contributor

laurelfulford commented Jan 19, 2026

Should I use it anyway (adds sharing buttons to these pages) or create a new post-meta-compact pattern that matches the current design?

@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.

@rbcorrales
Copy link
Member Author

@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 Block Types headers were missing the Newspack blocks. Added: ede55f9.

Copy link
Contributor

@laurelfulford laurelfulford left a comment

Choose a reason for hiding this comment

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

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! 🙌

@rbcorrales rbcorrales changed the title feat(byline): add byline block support to post-meta patterns feat(byline): add byline block support to patterns and templates Jan 21, 2026
@rbcorrales rbcorrales merged commit c0d8a90 into trunk Jan 21, 2026
6 checks passed
@rbcorrales rbcorrales deleted the feat/byline-block-patterns branch January 21, 2026 01:02
dkoo added a commit that referenced this pull request Jan 22, 2026
* 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>
matticbot pushed a commit that referenced this pull request Feb 2, 2026
# [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))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.23.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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants