From 0ed990c294ef0a9c586d62287863a639d55a7d1e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 8 Feb 2024 19:32:15 +0000 Subject: [PATCH] Twenty Twenty-Two: Prefix the `pages` block pattern category name. If a plugin also registers the category name `pages` 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 poena, swissspidy, shailu25. Fixes #59839. Built from https://develop.svn.wordpress.org/trunk@57569 git-svn-id: http://core.svn.wordpress.org/trunk@57070 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../themes/twentytwentytwo/inc/block-patterns.php | 10 +++++----- .../patterns/page-about-large-image-and-buttons.php | 2 +- .../inc/patterns/page-about-links-dark.php | 2 +- .../twentytwentytwo/inc/patterns/page-about-links.php | 2 +- .../inc/patterns/page-about-media-left.php | 2 +- .../inc/patterns/page-about-media-right.php | 2 +- .../inc/patterns/page-about-simple-dark.php | 2 +- .../inc/patterns/page-about-solid-color.php | 2 +- .../inc/patterns/page-layout-image-and-text.php | 2 +- .../inc/patterns/page-layout-image-text-and-video.php | 2 +- .../inc/patterns/page-layout-two-columns.php | 2 +- .../inc/patterns/page-sidebar-blog-posts-right.php | 2 +- .../inc/patterns/page-sidebar-blog-posts.php | 2 +- .../inc/patterns/page-sidebar-grid-posts.php | 2 +- .../inc/patterns/page-sidebar-poster.php | 2 +- wp-includes/version.php | 2 +- 16 files changed, 20 insertions(+), 20 deletions(-) diff --git a/wp-content/themes/twentytwentytwo/inc/block-patterns.php b/wp-content/themes/twentytwentytwo/inc/block-patterns.php index ce5e331798..f47e26e5dd 100644 --- a/wp-content/themes/twentytwentytwo/inc/block-patterns.php +++ b/wp-content/themes/twentytwentytwo/inc/block-patterns.php @@ -14,11 +14,11 @@ */ function twentytwentytwo_register_block_patterns() { $block_pattern_categories = array( - 'featured' => array( 'label' => __( 'Featured', 'twentytwentytwo' ) ), - 'footer' => array( 'label' => __( 'Footers', 'twentytwentytwo' ) ), - 'header' => array( 'label' => __( 'Headers', 'twentytwentytwo' ) ), - 'query' => array( 'label' => __( 'Query', 'twentytwentytwo' ) ), - 'pages' => array( 'label' => __( 'Pages', 'twentytwentytwo' ) ), + 'featured' => array( 'label' => __( 'Featured', 'twentytwentytwo' ) ), + 'footer' => array( 'label' => __( 'Footers', 'twentytwentytwo' ) ), + 'header' => array( 'label' => __( 'Headers', 'twentytwentytwo' ) ), + 'query' => array( 'label' => __( 'Query', 'twentytwentytwo' ) ), + 'twentytwentytwo_pages' => array( 'label' => __( 'Pages', 'twentytwentytwo' ) ), ); /** diff --git a/wp-content/themes/twentytwentytwo/inc/patterns/page-about-large-image-and-buttons.php b/wp-content/themes/twentytwentytwo/inc/patterns/page-about-large-image-and-buttons.php index 12d44e793b..52dbd0e2eb 100644 --- a/wp-content/themes/twentytwentytwo/inc/patterns/page-about-large-image-and-buttons.php +++ b/wp-content/themes/twentytwentytwo/inc/patterns/page-about-large-image-and-buttons.php @@ -4,7 +4,7 @@ */ return array( 'title' => __( 'About page with large image and buttons', 'twentytwentytwo' ), - 'categories' => array( 'pages', 'buttons' ), + 'categories' => array( 'twentytwentytwo_pages', 'buttons' ), 'content' => '
diff --git a/wp-content/themes/twentytwentytwo/inc/patterns/page-about-links-dark.php b/wp-content/themes/twentytwentytwo/inc/patterns/page-about-links-dark.php index ccb0ec2005..943524f49d 100644 --- a/wp-content/themes/twentytwentytwo/inc/patterns/page-about-links-dark.php +++ b/wp-content/themes/twentytwentytwo/inc/patterns/page-about-links-dark.php @@ -4,7 +4,7 @@ */ return array( 'title' => __( 'About page links (dark)', 'twentytwentytwo' ), - 'categories' => array( 'pages', 'buttons' ), + 'categories' => array( 'twentytwentytwo_pages', 'buttons' ), 'content' => '