From bc41987add96515630d8d998025903dedd320537 Mon Sep 17 00:00:00 2001 From: Miguel Fonseca Date: Fri, 16 Sep 2022 08:33:46 +0100 Subject: [PATCH] Compat: Block Patterns: Add new Footers category (#44200) See https://core.trac.wordpress.org/ticket/56416 See https://core.trac.wordpress.org/changeset/53943 --- lib/compat/wordpress-6.1/block-patterns.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/compat/wordpress-6.1/block-patterns.php b/lib/compat/wordpress-6.1/block-patterns.php index 32a923406d4e9..1a7fe16d4685a 100644 --- a/lib/compat/wordpress-6.1/block-patterns.php +++ b/lib/compat/wordpress-6.1/block-patterns.php @@ -186,6 +186,12 @@ function gutenberg_register_theme_block_patterns() { function gutenberg_register_core_block_patterns() { $should_register_core_patterns = get_theme_support( '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 ( $should_register_core_patterns ) { $core_block_patterns = array( 'centered-footer',