Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Add a WordPress credit block pattern and load it in the footer #56

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions block-template-parts/footer.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"max(1.25rem, 5vw)","top":"8rem","right":"max(1.25rem, 5vw)","left":"max(1.25rem, 5vw)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} -->
<div class="wp-block-group alignwide" style="padding-top:8rem;padding-right:max(1.25rem, 5vw);padding-bottom:max(1.25rem, 5vw);padding-left:max(1.25rem, 5vw)"><!-- wp:site-title {"level":0} /-->

<!-- wp:paragraph {"align":"right"} -->
<p class="has-text-align-right">Proudly Powered by <a href="https://wordpress.org" rel="nofollow">WordPress</a></p>
<!-- /wp:paragraph --></div>
<!-- wp:pattern {"slug":"twentytwentytwo/wordpress-credit"} /-->

</div>
<!-- /wp:group -->
6 changes: 5 additions & 1 deletion inc/block-patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*
* @since 1.0
*/

if ( ! function_exists( 'twentytwentytwo_register_block_patterns' ) ) :
function twentytwentytwo_register_block_patterns() {
if ( function_exists( 'register_block_pattern_category' ) ) {
Expand All @@ -20,6 +19,10 @@ function twentytwentytwo_register_block_patterns() {
'twentytwentytwo-query',
array( 'label' => __( 'Twenty Twenty-Two Posts', 'twentytwentytwo' ) )
);
register_block_pattern_category(
'twentytwentytwo-i18n',
array( 'label' => __( 'Twenty Twenty-Two i18n', 'twentytwentytwo' ) )
);
}
if ( function_exists( 'register_block_pattern' ) ) {
$block_patterns = array(
Expand Down Expand Up @@ -57,6 +60,7 @@ function twentytwentytwo_register_block_patterns() {
'query-image-grid',
'query-large-titles',
'query-irregular-grid',
'wordpress-credit',
);

foreach ( $block_patterns as $block_pattern ) {
Expand Down
12 changes: 12 additions & 0 deletions inc/patterns/wordpress-credit.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
/**
* WordPress Credit block pattern
*
*/
return array(
'title' => __( 'WordPress Credit', 'twentytwentytwo' ),
'categories' => array( 'twentytwentytwo-i18n' ),
'content' => '<!-- wp:paragraph {"align":"right"} -->
<p class="has-text-align-right">' . __( 'Proudly powered by ', 'twentytwentytwo' ) . '<a href="https://wordpress.org" rel="nofollow">WordPress</a></p>
<!-- /wp:paragraph -->',
);