Make WordPress Core


Ignore:
Timestamp:
12/14/2021 05:09:04 PM (2 years ago)
Author:
jffng
Message:

Twenty Twenty-Two: Sync updates from GitHub for Beta 3.

This commit syncs minor changes for the default theme from its active development repository to core.

This is a follow up to [52081], [52107], [52164], [52222], [52283], and [52335]. The two main changes introduce global padding to site content while still allowing content to be full-width, and re-organize block patterns into Core's existing categories.

To view the full set of changes, visit https://github.com/WordPress/twentytwentytwo/compare/da994d1fe50c016cd11ecf33da7de33f652184e4...88a8f2e3b4c6653e2deb5c29ae0b7e42b1f99433.

Props onemaggie, joen, youknowriad, scruffian, sabernhardt, kjellr.
See #54318.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentytwentytwo/inc/block-patterns.php

    r52222 r52375  
    1313function twentytwentytwo_register_block_patterns() {
    1414    $block_pattern_categories = array(
    15         'twentytwentytwo-general' => array( 'label' => __( 'Twenty Twenty-Two General', 'twentytwentytwo' ) ),
    16         'twentytwentytwo-footers' => array( 'label' => __( 'Twenty Twenty-Two Footers', 'twentytwentytwo' ) ),
    17         'twentytwentytwo-headers' => array( 'label' => __( 'Twenty Twenty-Two Headers', 'twentytwentytwo' ) ),
    18         'twentytwentytwo-query'   => array( 'label' => __( 'Twenty Twenty-Two Posts', 'twentytwentytwo' ) ),
    19         'twentytwentytwo-pages'   => array( 'label' => __( 'Twenty Twenty-Two Pages', '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' ) ),
    2020    );
    2121
     
    3838
    3939    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        }
    4143    }
    4244
     
    121123
    122124    foreach ( $block_patterns as $block_pattern ) {
     125        $pattern_file = get_theme_file_path( '/inc/patterns/' . $block_pattern . '.php' );
     126
    123127        register_block_pattern(
    124128            'twentytwentytwo/' . $block_pattern,
    125             require __DIR__ . '/patterns/' . $block_pattern . '.php'
     129            require $pattern_file
    126130        );
    127131    }
Note: See TracChangeset for help on using the changeset viewer.