From e754cc795ca6a45f21a9c0ef112d58e5d992718d Mon Sep 17 00:00:00 2001 From: Rich Tabor Date: Thu, 12 Oct 2023 15:00:37 -0400 Subject: [PATCH 1/3] Add register_block_pattern_category --- functions.php | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/functions.php b/functions.php index e569d5b8..64aad111 100644 --- a/functions.php +++ b/functions.php @@ -9,7 +9,7 @@ */ /** - * Register block Styles + * Register block styles */ if ( ! function_exists( 'twentytwentyfour_block_styles' ) ) : @@ -165,3 +165,26 @@ function twentytwentyfour_block_styles() { endif; add_action( 'init', 'twentytwentyfour_block_styles' ); + +/** + * Register pattern categories. + */ + +if ( ! function_exists( 'twentytwentyfour_pattern_categories' ) ) : + /** + * Register pattern categories + * + * @return void + * @since Twenty Twenty-Four 1.0 + * + */ + function twentytwentyfour_pattern_categories() { + + register_block_pattern_category( 'page', array( + 'label' => __( 'Pages', 'twentytwentyfour' ), + ) ); + + } +endif; + +add_action( 'init', 'twentytwentyfour_pattern_categories' ); From 5ca1d2b8e74647c515915dce9eafaac3eec4053a Mon Sep 17 00:00:00 2001 From: Rich Tabor Date: Thu, 12 Oct 2023 15:00:53 -0400 Subject: [PATCH 2/3] Move page patterns into the page category --- patterns/page-01-business-home.php | 4 ++-- patterns/page-02-business-about.php | 4 ++-- patterns/page-03-portfolio-overview.php | 4 ++-- patterns/page-04-newsletter-landing.php | 4 ++-- patterns/page-05-portfolio-home.php | 4 ++-- patterns/page-06-writer-home.php | 4 ++-- patterns/page-07-rsvp-landing.php | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/patterns/page-01-business-home.php b/patterns/page-01-business-home.php index fade6745..6ba19054 100644 --- a/patterns/page-01-business-home.php +++ b/patterns/page-01-business-home.php @@ -2,8 +2,8 @@ /** * Title: Home Page * Slug: twentytwentyfour/home - * Categories: about - * Keywords: page, starter + * Categories: page + * Keywords: starter * Block Types: core/post-content * Post Types: page, wp_template * Viewport width: 1400 diff --git a/patterns/page-02-business-about.php b/patterns/page-02-business-about.php index 7a499a5c..774d053d 100644 --- a/patterns/page-02-business-about.php +++ b/patterns/page-02-business-about.php @@ -2,8 +2,8 @@ /** * Title: About Page * Slug: twentytwentyfour/business-about - * Categories: about - * Keywords: page, starter + * Categories: page + * Keywords: starter * Block Types: core/post-content * Post Types: page, wp_template * Viewport width: 1400 diff --git a/patterns/page-03-portfolio-overview.php b/patterns/page-03-portfolio-overview.php index 03630dbb..91865f88 100644 --- a/patterns/page-03-portfolio-overview.php +++ b/patterns/page-03-portfolio-overview.php @@ -2,8 +2,8 @@ /** * Title: Portfolio Overview Page * Slug: twentytwentyfour/portfolio-overview - * Categories: about, featured - * Keywords: page, starter + * Categories: page, featured + * Keywords: starter * Block Types: core/post-content * Post Types: page, wp_template * Viewport width: 1400 diff --git a/patterns/page-04-newsletter-landing.php b/patterns/page-04-newsletter-landing.php index 2cb0196f..81eaf5c0 100644 --- a/patterns/page-04-newsletter-landing.php +++ b/patterns/page-04-newsletter-landing.php @@ -2,8 +2,8 @@ /** * Title: Newsletter Landing Page * Slug: twentytwentyfour/newsletter-landing - * Categories: call-to-action, featured - * Keywords: page, starter + * Categories: call-to-action, page, featured + * Keywords: starter * Block Types: core/post-content * Post Types: page, wp_template * Viewport width: 1100 diff --git a/patterns/page-05-portfolio-home.php b/patterns/page-05-portfolio-home.php index c8841d00..94a143d4 100644 --- a/patterns/page-05-portfolio-home.php +++ b/patterns/page-05-portfolio-home.php @@ -2,8 +2,8 @@ /** * Title: Portfolio Home Page * Slug: twentytwentyfour/portfolio-home - * Categories: portfolio - * Keywords: page, starter + * Categories: page + * Keywords: starter * Block Types: core/post-content * Post Types: page, wp_template * Viewport width: 1400 diff --git a/patterns/page-06-writer-home.php b/patterns/page-06-writer-home.php index 16f0dac1..f9d01407 100644 --- a/patterns/page-06-writer-home.php +++ b/patterns/page-06-writer-home.php @@ -2,8 +2,8 @@ /** * Title: Writer Home Page * Slug: twentytwentyfour/writer-home - * Categories: text, page - * Keywords: page, starter + * Categories: page + * Keywords: starter * Block Types: core/post-content * Post Types: page, wp_template * Viewport width: 1400 diff --git a/patterns/page-07-rsvp-landing.php b/patterns/page-07-rsvp-landing.php index d547e4f5..e934655e 100644 --- a/patterns/page-07-rsvp-landing.php +++ b/patterns/page-07-rsvp-landing.php @@ -2,8 +2,8 @@ /** * Title: RSVP Landing Page * Slug: twentytwentyfour/rsvp-landing - * Categories: call-to-action, featured - * Keywords: page, starter + * Categories: page, call-to-action, featured + * Keywords: starter * Block Types: core/post-content * Post Types: page, wp_template * Viewport width: 1100 From e353ec4eab82b68f2218ec703dd02e6247bb6d56 Mon Sep 17 00:00:00 2001 From: Rich Tabor Date: Thu, 12 Oct 2023 15:31:00 -0400 Subject: [PATCH 3/3] Update functions.php --- functions.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/functions.php b/functions.php index 64aad111..a7c7ad19 100644 --- a/functions.php +++ b/functions.php @@ -180,10 +180,13 @@ function twentytwentyfour_block_styles() { */ function twentytwentyfour_pattern_categories() { - register_block_pattern_category( 'page', array( - 'label' => __( 'Pages', 'twentytwentyfour' ), - ) ); - + register_block_pattern_category( + 'page', + array( + 'label' => _x( 'Pages', 'Block pattern category' ), + 'description' => __( 'A collection of full page layouts.' ), + ) + ); } endif;