register_block_pattern_category example



if ( function_exists( 'register_block_pattern_category' ) ) {
    /** * Register Block Pattern Category. * * @since Twenty Twenty-One 1.0 * * @return void */
    function twenty_twenty_one_register_block_pattern_category() {
        register_block_pattern_category(
            'twentytwentyone',
            array( 'label' => esc_html__( 'Twenty Twenty-One', 'twentytwentyone' ) )
        );
    }
    add_action( 'init', 'twenty_twenty_one_register_block_pattern_category' );
}

/** * Register Block Patterns. */
if ( function_exists( 'register_block_pattern' ) ) {
    
'query-offset-posts',
            'social-links-shared-background-color',
        );

        foreach ( $core_block_patterns as $core_block_pattern ) {
            $pattern           = require __DIR__ . '/block-patterns/' . $core_block_pattern . '.php';
            $pattern['source'] = 'core';
            register_block_pattern( 'core/' . $core_block_pattern$pattern );
        }
    }

    register_block_pattern_category( 'banner', array( 'label' => _x( 'Banners', 'Block pattern category' ) ) );
    register_block_pattern_category(
        'buttons',
        array(
            'label'       => _x( 'Buttons', 'Block pattern category' ),
            'description' => __( 'Patterns that contain buttons and call to actions.' ),
        )
    );
    register_block_pattern_category(
        'columns',
        array(
            'label'       => _x( 'Columns', 'Block pattern category' ),
            

    $block_pattern_categories = apply_filters( 'twentytwentytwo_block_pattern_categories', $block_pattern_categories );

    foreach ( $block_pattern_categories as $name => $properties ) {
        if ( ! WP_Block_Pattern_Categories_Registry::get_instance()->is_registered( $name ) ) {
            register_block_pattern_category( $name$properties );
        }
    }

    $block_patterns = array(
        'footer-default',
        'footer-dark',
        'footer-logo',
        'footer-navigation',
        'footer-title-tagline-social',
        'footer-social-copyright',
        'footer-navigation-copyright',
        
Home | Imprint | This part of the site doesn't use cookies.