Skip to content
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

Add author block pattern #40076

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/compat/wordpress-6.0/block-patterns-update.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,18 @@ function gutenberg_register_gutenberg_patterns() {
<!-- wp:social-link {"url":"#","service":"mail"} /--></ul>
<!-- /wp:social-links -->',
),
'author-biograhy-border' => array(
'title' => _x( 'Post author biography with avatar and border', 'Block pattern title', 'gutenberg' ),
'categories' => array( 'text' ),
'blockTypes' => array( 'core/post-author-name', 'core/post-author-biography', 'core/avatar' ),
Copy link
Member

Choose a reason for hiding this comment

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

It means that we would need all 3 blocks to be promoted to stable to include this new pattern in WordPress 6.0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or did you mean, that they should be moved to stable with this PR?

Copy link
Member

Choose a reason for hiding this comment

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

I was thinking we should do it separately as a pre-requisite for this PR.

'content' => '<!-- wp:group {"style":{"border":{"width":"1px","style":"solid"},"spacing":{"padding":{"top":"1rem","right":"1rem","bottom":"1rem","left":"1rem"}}},"borderColor":"cyan-bluish-gray","layout":{"type":"flex","justifyContent":"space-between","flexWrap":"nowrap"}} -->
<div class="wp-block-group has-border-color has-cyan-bluish-gray-border-color" style="border-style:solid;border-width:1px;padding-top:1rem;padding-right:1rem;padding-bottom:1rem;padding-left:1rem">
<!-- wp:group --><div class="wp-block-group">
<!-- wp:post-author-name {"isLink":true,"style":{"typography":{"fontStyle":"normal","fontWeight":"600"}}} /--><!-- wp:post-author-biography {"fontSize":"small"} /-->
</div><!-- /wp:group -->
<!-- wp:avatar {"size":80,"isLink":true,"align":"right","style":{"border":{"radius":"9999px"}}} /--></div>
<!-- /wp:group -->',
),
);

foreach ( $patterns as $name => $pattern ) {
Expand Down