Skip to content

Commit

Permalink
Block Patterns: Add category for banners (#44203)
Browse files Browse the repository at this point in the history
* Block Patterns: Add category for Headings & Titles

Fixes #40116

With this new category, we can clariy the classification of patterns as
"Headers". Category "Headers" pertains to global patterns meant to sit
at the top of a page, while category "Headings & Titles" pertains to
typically visually distinctive elements that help structure the contents
of a page.

* Rename to "Banners"
  • Loading branch information
mcsf authored Sep 19, 2022
1 parent af8d9fc commit 4fa05b8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/compat/wordpress-6.1/block-patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,15 @@ function gutenberg_register_core_block_patterns() {

// Register categories used for block patterns.
$pattern_category_registry = WP_Block_Pattern_Categories_Registry::get_instance();

if ( ! $pattern_category_registry->is_registered( 'footer' ) ) {
register_block_pattern_category( 'footer', array( 'label' => __( 'Footers', 'gutenberg' ) ) );
}

if ( ! $pattern_category_registry->is_registered( 'banner' ) ) {
register_block_pattern_category( 'banner', array( 'label' => __( 'Banners', 'gutenberg' ) ) );
}

if ( $should_register_core_patterns ) {
$core_block_patterns = array(
'centered-footer',
Expand Down

0 comments on commit 4fa05b8

Please sign in to comment.