- Timestamp:
- 12/14/2021 05:09:04 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentytwentytwo/inc/block-patterns.php
r52222 r52375 13 13 function twentytwentytwo_register_block_patterns() { 14 14 $block_pattern_categories = array( 15 ' twentytwentytwo-general' => array( 'label' => __( 'Twenty Twenty-Two General', 'twentytwentytwo' ) ),16 ' twentytwentytwo-footers' => array( 'label' => __( 'Twenty Twenty-TwoFooters', 'twentytwentytwo' ) ),17 ' twentytwentytwo-headers' => array( 'label' => __( 'Twenty Twenty-TwoHeaders', 'twentytwentytwo' ) ),18 ' twentytwentytwo-query' => array( 'label' => __( 'Twenty Twenty-Two Posts', 'twentytwentytwo' ) ),19 ' twentytwentytwo-pages' => array( 'label' => __( 'Twenty Twenty-TwoPages', 'twentytwentytwo' ) ),15 'featured' => array( 'label' => __( 'Featured', 'twentytwentytwo' ) ), 16 'footer' => array( 'label' => __( 'Footers', 'twentytwentytwo' ) ), 17 'header' => array( 'label' => __( 'Headers', 'twentytwentytwo' ) ), 18 'query' => array( 'label' => __( 'Query', 'twentytwentytwo' ) ), 19 'pages' => array( 'label' => __( 'Pages', 'twentytwentytwo' ) ), 20 20 ); 21 21 … … 38 38 39 39 foreach ( $block_pattern_categories as $name => $properties ) { 40 register_block_pattern_category( $name, $properties ); 40 if ( ! WP_Block_Pattern_Categories_Registry::get_instance()->is_registered( $name ) ) { 41 register_block_pattern_category( $name, $properties ); 42 } 41 43 } 42 44 … … 121 123 122 124 foreach ( $block_patterns as $block_pattern ) { 125 $pattern_file = get_theme_file_path( '/inc/patterns/' . $block_pattern . '.php' ); 126 123 127 register_block_pattern( 124 128 'twentytwentytwo/' . $block_pattern, 125 require __DIR__ . '/patterns/' . $block_pattern . '.php'129 require $pattern_file 126 130 ); 127 131 }
Note: See TracChangeset
for help on using the changeset viewer.