From c1d23f901ff98b298ce46082fb67cfbabb5f62fd Mon Sep 17 00:00:00 2001 From: Jeff Ong Date: Thu, 7 Oct 2021 14:19:34 -0400 Subject: [PATCH 1/3] Add a WordPress credit block pattern and load it in the template. --- block-template-parts/footer.html | 6 +++--- inc/block-patterns.php | 1 + inc/patterns/wordpress-credit.php | 12 ++++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 inc/patterns/wordpress-credit.php diff --git a/block-template-parts/footer.html b/block-template-parts/footer.html index 6a83627c..3b219eb1 100644 --- a/block-template-parts/footer.html +++ b/block-template-parts/footer.html @@ -1,7 +1,7 @@
- -

Proudly Powered by WordPress

-
+ + + \ No newline at end of file diff --git a/inc/block-patterns.php b/inc/block-patterns.php index 6fcf0946..0c4f0229 100644 --- a/inc/block-patterns.php +++ b/inc/block-patterns.php @@ -57,6 +57,7 @@ function twentytwentytwo_register_block_patterns() { 'query-image-grid', 'query-large-titles', 'query-irregular-grid', + 'wordpress-credit', ); foreach ( $block_patterns as $block_pattern ) { diff --git a/inc/patterns/wordpress-credit.php b/inc/patterns/wordpress-credit.php new file mode 100644 index 00000000..dbf4c2a0 --- /dev/null +++ b/inc/patterns/wordpress-credit.php @@ -0,0 +1,12 @@ + __( 'WordPress Credit', 'twentytwentytwo' ), + 'categories' => array( 'twentytwentytwo' ), + 'content' => ' +

' . __( 'Proudly powered by ', 'twentytwentytwo' ) . 'WordPress

+' +); \ No newline at end of file From fdf51ddf3762437197a230e04f2a44d59e198666 Mon Sep 17 00:00:00 2001 From: Jeff Ong Date: Thu, 7 Oct 2021 14:22:59 -0400 Subject: [PATCH 2/3] Replace theme name. --- inc/block-patterns.php | 1 - 1 file changed, 1 deletion(-) diff --git a/inc/block-patterns.php b/inc/block-patterns.php index 0c4f0229..7d8ae71d 100644 --- a/inc/block-patterns.php +++ b/inc/block-patterns.php @@ -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' ) ) { From 4d7091bb24f470397121d8a47a571681e5683105 Mon Sep 17 00:00:00 2001 From: Jeff Ong Date: Tue, 12 Oct 2021 13:05:14 -0400 Subject: [PATCH 3/3] Change pattern category. --- inc/block-patterns.php | 4 ++++ inc/patterns/wordpress-credit.php | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/inc/block-patterns.php b/inc/block-patterns.php index 7d8ae71d..82923603 100644 --- a/inc/block-patterns.php +++ b/inc/block-patterns.php @@ -19,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( diff --git a/inc/patterns/wordpress-credit.php b/inc/patterns/wordpress-credit.php index dbf4c2a0..b31f450b 100644 --- a/inc/patterns/wordpress-credit.php +++ b/inc/patterns/wordpress-credit.php @@ -4,9 +4,9 @@ * */ return array( - 'title' => __( 'WordPress Credit', 'twentytwentytwo' ), - 'categories' => array( 'twentytwentytwo' ), - 'content' => ' + 'title' => __( 'WordPress Credit', 'twentytwentytwo' ), + 'categories' => array( 'twentytwentytwo-i18n' ), + 'content' => '

' . __( 'Proudly powered by ', 'twentytwentytwo' ) . 'WordPress

-' -); \ No newline at end of file +', +);