Skip to content

feat(patterns): use author profile block in author bio patterns#424

Open
rbcorrales wants to merge 1 commit intotrunkfrom
feat/author-bio-profile-block
Open

feat(patterns): use author profile block in author bio patterns#424
rbcorrales wants to merge 1 commit intotrunkfrom
feat/author-bio-profile-block

Conversation

@rbcorrales
Copy link
Member

@rbcorrales rbcorrales commented Mar 11, 2026

All Submissions:

Changes proposed in this Pull Request:

Updates the author bio patterns (author-bio and author-bio-avatar) to use the Author Profile block with layout variations when newspack-blocks is available. The patterns set only the variation attribute (avatar-left or compact) and rely on the block's JS auto-populate logic to fill inner blocks from the variation template, keeping pattern markup minimal. Falls back to the existing core blocks (avatar, post-author-name, post-author-biography) when the Author Profile block is not registered.

Closes NPPD-1221.


Feedback required: Since newspack-blocks is always expected to be active on Newspack sites, is the PHP fallback to core blocks necessary? Two options to consider:

  1. Drop the PHP conditional and make the patterns pure HTML with just the Author Profile block reference.
  2. Drop the patterns entirely and inline the Author Profile block directly in parts/post-footer.html, since the patterns are essentially thin wrappers (separators + the block) at this point.

How to test the changes in this Pull Request:

  1. Activate the block theme with newspack-blocks active.
  2. Go to Appearance > Editor > Templates > Single Posts.
  3. Open the block inserter, go to Patterns tab, select "Newspack Theme - Author Bio" category.
  4. Insert "Author Bio with Avatar" and verify it auto-populates the avatar-left variation with all fields (name, job title, role, employer, bio, archive link, social links) in a two-column layout.
  5. Insert "Author Bio" and verify it auto-populates the compact variation with all fields in a vertical stack layout.
  6. Select each inserted Author Profile block and confirm the block attributes include variation: "avatar-left" or variation: "compact", layoutVersion: 2, and isContextual: true.
  7. Open a post in the post editor, insert both patterns, and verify author data populates from the post's actual author.
  8. View the post on the frontend and verify the author profile renders correctly.
  9. Deactivate newspack-blocks and verify the patterns fall back to core blocks (avatar, post-author-name, post-author-biography).
  10. Verify the Post Footer template part still works correctly since it references newspack-block-theme/author-bio via wp:pattern.

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 updates the theme’s Author Bio block patterns to prefer the newspack-blocks/author-profile block (using the compact and avatar-left variations) when that block is registered, while preserving the existing core-block markup as a fallback when it isn’t.

Changes:

  • Add conditional rendering in author bio patterns to use newspack-blocks/author-profile when available.
  • Keep a PHP fallback to existing core blocks (core/avatar, core/post-author-name, core/post-author-biography) when the Author Profile block isn’t registered.
  • Update pattern metadata (Block Types) to include newspack-blocks/author-profile.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
patterns/author-bio/author-bio.php Uses Author Profile block variation compact when registered; otherwise falls back to core author name + biography blocks.
patterns/author-bio/author-bio-avatar.php Uses Author Profile block variation avatar-left when registered; otherwise falls back to core avatar + author name + biography blocks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rbcorrales rbcorrales marked this pull request as ready for review March 11, 2026 23:24
@rbcorrales rbcorrales requested a review from a team as a code owner March 11, 2026 23:24
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.

2 participants