From 50af5dbed1ddda38a4033c805d877d552e83e7b9 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 7 Feb 2024 19:43:09 +0000 Subject: [PATCH] Twenty Twenty-Four: Prefix the block pattern category name. If a plugin also registers the category name `page` in an `init` hook that runs after the theme's, it can override the label and description unintentionally. With a prefix, extenders can still override it, but it would be intentional. Props shailu25, poena, acosmin, harshgajipara, swissspidy. See #59839. git-svn-id: https://develop.svn.wordpress.org/trunk@57555 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-content/themes/twentytwentyfour/functions.php | 2 +- .../themes/twentytwentyfour/patterns/page-about-business.php | 2 +- .../themes/twentytwentyfour/patterns/page-home-blogging.php | 2 +- .../themes/twentytwentyfour/patterns/page-home-business.php | 2 +- .../twentytwentyfour/patterns/page-home-portfolio-gallery.php | 2 +- .../themes/twentytwentyfour/patterns/page-home-portfolio.php | 2 +- .../twentytwentyfour/patterns/page-newsletter-landing.php | 2 +- .../twentytwentyfour/patterns/page-portfolio-overview.php | 2 +- .../themes/twentytwentyfour/patterns/page-rsvp-landing.php | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/wp-content/themes/twentytwentyfour/functions.php b/src/wp-content/themes/twentytwentyfour/functions.php index baee062f6f..8536cb8423 100644 --- a/src/wp-content/themes/twentytwentyfour/functions.php +++ b/src/wp-content/themes/twentytwentyfour/functions.php @@ -194,7 +194,7 @@ if ( ! function_exists( 'twentytwentyfour_pattern_categories' ) ) : function twentytwentyfour_pattern_categories() { register_block_pattern_category( - 'page', + 'twentytwentyfour_page', array( 'label' => _x( 'Pages', 'Block pattern category', 'twentytwentyfour' ), 'description' => __( 'A collection of full page layouts.', 'twentytwentyfour' ), diff --git a/src/wp-content/themes/twentytwentyfour/patterns/page-about-business.php b/src/wp-content/themes/twentytwentyfour/patterns/page-about-business.php index f04b20940c..ad626980e1 100644 --- a/src/wp-content/themes/twentytwentyfour/patterns/page-about-business.php +++ b/src/wp-content/themes/twentytwentyfour/patterns/page-about-business.php @@ -2,7 +2,7 @@ /** * Title: About * Slug: twentytwentyfour/page-about-business - * Categories: page + * Categories: twentytwentyfour_page * Keywords: starter * Block Types: core/post-content * Post Types: page, wp_template diff --git a/src/wp-content/themes/twentytwentyfour/patterns/page-home-blogging.php b/src/wp-content/themes/twentytwentyfour/patterns/page-home-blogging.php index ae88e9006c..5cef5d4e50 100644 --- a/src/wp-content/themes/twentytwentyfour/patterns/page-home-blogging.php +++ b/src/wp-content/themes/twentytwentyfour/patterns/page-home-blogging.php @@ -2,7 +2,7 @@ /** * Title: Blogging home * Slug: twentytwentyfour/page-home-blogging - * Categories: page + * Categories: twentytwentyfour_page * Keywords: page, starter * Post Types: page, wp_template * Viewport width: 1400 diff --git a/src/wp-content/themes/twentytwentyfour/patterns/page-home-business.php b/src/wp-content/themes/twentytwentyfour/patterns/page-home-business.php index ca22952174..415c42f1d9 100644 --- a/src/wp-content/themes/twentytwentyfour/patterns/page-home-business.php +++ b/src/wp-content/themes/twentytwentyfour/patterns/page-home-business.php @@ -2,7 +2,7 @@ /** * Title: Business home * Slug: twentytwentyfour/page-home-business - * Categories: page + * Categories: twentytwentyfour_page * Keywords: starter * Block Types: core/post-content * Post Types: page, wp_template diff --git a/src/wp-content/themes/twentytwentyfour/patterns/page-home-portfolio-gallery.php b/src/wp-content/themes/twentytwentyfour/patterns/page-home-portfolio-gallery.php index cce1fdb106..a9ce9d760a 100644 --- a/src/wp-content/themes/twentytwentyfour/patterns/page-home-portfolio-gallery.php +++ b/src/wp-content/themes/twentytwentyfour/patterns/page-home-portfolio-gallery.php @@ -2,7 +2,7 @@ /** * Title: Portfolio home image gallery * Slug: twentytwentyfour/page-home-gallery - * Categories: page + * Categories: twentytwentyfour_page * Keywords: starter * Block Types: core/post-content * Post Types: page, wp_template diff --git a/src/wp-content/themes/twentytwentyfour/patterns/page-home-portfolio.php b/src/wp-content/themes/twentytwentyfour/patterns/page-home-portfolio.php index 4f3c473f0b..40d4fa1e75 100644 --- a/src/wp-content/themes/twentytwentyfour/patterns/page-home-portfolio.php +++ b/src/wp-content/themes/twentytwentyfour/patterns/page-home-portfolio.php @@ -2,7 +2,7 @@ /** * Title: Portfolio home with post featured images * Slug: twentytwentyfour/page-home-portfolio - * Categories: page + * Categories: twentytwentyfour_page * Keywords: starter * Block Types: core/post-content * Post Types: page, wp_template diff --git a/src/wp-content/themes/twentytwentyfour/patterns/page-newsletter-landing.php b/src/wp-content/themes/twentytwentyfour/patterns/page-newsletter-landing.php index 24c6d9a86f..5ee552e500 100644 --- a/src/wp-content/themes/twentytwentyfour/patterns/page-newsletter-landing.php +++ b/src/wp-content/themes/twentytwentyfour/patterns/page-newsletter-landing.php @@ -2,7 +2,7 @@ /** * Title: Newsletter landing * Slug: twentytwentyfour/page-newsletter-landing - * Categories: call-to-action, page, featured + * Categories: call-to-action, twentytwentyfour_page, featured * Keywords: starter * Block Types: core/post-content * Post Types: page, wp_template diff --git a/src/wp-content/themes/twentytwentyfour/patterns/page-portfolio-overview.php b/src/wp-content/themes/twentytwentyfour/patterns/page-portfolio-overview.php index 3e29b11387..b0bf21b480 100644 --- a/src/wp-content/themes/twentytwentyfour/patterns/page-portfolio-overview.php +++ b/src/wp-content/themes/twentytwentyfour/patterns/page-portfolio-overview.php @@ -2,7 +2,7 @@ /** * Title: Portfolio project overview * Slug: twentytwentyfour/page-portfolio-overview - * Categories: page, featured + * Categories: twentytwentyfour_page, featured * Keywords: starter * Block Types: core/post-content * Post Types: page, wp_template diff --git a/src/wp-content/themes/twentytwentyfour/patterns/page-rsvp-landing.php b/src/wp-content/themes/twentytwentyfour/patterns/page-rsvp-landing.php index 469a13426a..8b3ba8316c 100644 --- a/src/wp-content/themes/twentytwentyfour/patterns/page-rsvp-landing.php +++ b/src/wp-content/themes/twentytwentyfour/patterns/page-rsvp-landing.php @@ -2,7 +2,7 @@ /** * Title: RSVP landing * Slug: twentytwentyfour/page-rsvp-landing - * Categories: page + * Categories: twentytwentyfour_page * Keywords: starter * Block Types: core/post-content * Post Types: page, wp_template