diff --git a/wp-content/themes/twentytwentytwo/inc/block-patterns.php b/wp-content/themes/twentytwentytwo/inc/block-patterns.php index 055bb3ba7e..fbaa086395 100644 --- a/wp-content/themes/twentytwentytwo/inc/block-patterns.php +++ b/wp-content/themes/twentytwentytwo/inc/block-patterns.php @@ -12,11 +12,11 @@ */ function twentytwentytwo_register_block_patterns() { $block_pattern_categories = array( - 'twentytwentytwo-general' => array( 'label' => __( 'Twenty Twenty-Two General', 'twentytwentytwo' ) ), - 'twentytwentytwo-footers' => array( 'label' => __( 'Twenty Twenty-Two Footers', 'twentytwentytwo' ) ), - 'twentytwentytwo-headers' => array( 'label' => __( 'Twenty Twenty-Two Headers', 'twentytwentytwo' ) ), - 'twentytwentytwo-query' => array( 'label' => __( 'Twenty Twenty-Two Posts', 'twentytwentytwo' ) ), - 'twentytwentytwo-pages' => array( 'label' => __( 'Twenty Twenty-Two Pages', 'twentytwentytwo' ) ), + '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' ) ), ); /** @@ -37,7 +37,9 @@ function twentytwentytwo_register_block_patterns() { $block_pattern_categories = apply_filters( 'twentytwentytwo_block_pattern_categories', $block_pattern_categories ); foreach ( $block_pattern_categories as $name => $properties ) { - register_block_pattern_category( $name, $properties ); + if ( ! WP_Block_Pattern_Categories_Registry::get_instance()->is_registered( $name ) ) { + register_block_pattern_category( $name, $properties ); + } } $block_patterns = array( @@ -120,9 +122,11 @@ function twentytwentytwo_register_block_patterns() { $block_patterns = apply_filters( 'twentytwentytwo_block_patterns', $block_patterns ); foreach ( $block_patterns as $block_pattern ) { + $pattern_file = get_theme_file_path( '/inc/patterns/' . $block_pattern . '.php' ); + register_block_pattern( 'twentytwentytwo/' . $block_pattern, - require __DIR__ . '/patterns/' . $block_pattern . '.php' + require $pattern_file ); } } diff --git a/wp-content/themes/twentytwentytwo/inc/patterns/footer-about-title-logo.php b/wp-content/themes/twentytwentytwo/inc/patterns/footer-about-title-logo.php index 11d50be4af..d687970917 100644 --- a/wp-content/themes/twentytwentytwo/inc/patterns/footer-about-title-logo.php +++ b/wp-content/themes/twentytwentytwo/inc/patterns/footer-about-title-logo.php @@ -4,7 +4,7 @@ */ return array( 'title' => __( 'Footer with text, title, and logo', 'twentytwentytwo' ), - 'categories' => array( 'twentytwentytwo-footers' ), + 'categories' => array( 'footer' ), 'blockTypes' => array( 'core/template-part/footer' ), 'content' => '
@@ -21,7 +21,7 @@ return array( -
+ diff --git a/wp-content/themes/twentytwentytwo/inc/patterns/footer-blog.php b/wp-content/themes/twentytwentytwo/inc/patterns/footer-blog.php index 7462d53f39..4be192a3de 100644 --- a/wp-content/themes/twentytwentytwo/inc/patterns/footer-blog.php +++ b/wp-content/themes/twentytwentytwo/inc/patterns/footer-blog.php @@ -4,11 +4,11 @@ */ return array( 'title' => __( 'Blog footer', 'twentytwentytwo' ), - 'categories' => array( 'twentytwentytwo-footers' ), + 'categories' => array( 'footer' ), 'blockTypes' => array( 'core/template-part/footer' ), 'content' => ' -
-
+
+

' . esc_html__( 'About us', 'twentytwentytwo' ) . '

@@ -40,7 +40,7 @@ return array( -
+

' . diff --git a/wp-content/themes/twentytwentytwo/inc/patterns/footer-dark.php b/wp-content/themes/twentytwentytwo/inc/patterns/footer-dark.php index fb17ac3891..15c21c6b85 100644 --- a/wp-content/themes/twentytwentytwo/inc/patterns/footer-dark.php +++ b/wp-content/themes/twentytwentytwo/inc/patterns/footer-dark.php @@ -4,11 +4,11 @@ */ return array( 'title' => __( 'Dark footer with title and citation', 'twentytwentytwo' ), - 'categories' => array( 'twentytwentytwo-footers' ), + 'categories' => array( 'footer' ), 'blockTypes' => array( 'core/template-part/footer' ), 'content' => '