Make WordPress Core

Changeset 53312


Ignore:
Timestamp:
04/29/2022 02:08:44 PM (2 years ago)
Author:
gziolo
Message:

Editor: Fix core 'Featured' pattern category registration

Backports changes from https://github.com/WordPress/gutenberg/pull/40650.

Patch fixes regression, and moves core "Featured" pattern category registration from _load_remote_featured_patterns into _register_core_block_patterns_and_categories.

Follow-up [53152].
Props mamaduka, ntsekouras.
See #55567.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-patterns.php

    r53218 r53312  
    3939    register_block_pattern_category( 'buttons', array( 'label' => _x( 'Buttons', 'Block pattern category' ) ) );
    4040    register_block_pattern_category( 'columns', array( 'label' => _x( 'Columns', 'Block pattern category' ) ) );
     41    register_block_pattern_category( 'featured', array( 'label' => _x( 'Featured', 'Block pattern category' ) ) );
    4142    register_block_pattern_category( 'gallery', array( 'label' => _x( 'Gallery', 'Block pattern category' ) ) );
    4243    register_block_pattern_category( 'header', array( 'label' => _x( 'Headers', 'Block pattern category' ) ) );
     
    103104    if ( ! $should_load_remote || ! $supports_core_patterns ) {
    104105        return;
    105     }
    106 
    107     if ( ! WP_Block_Pattern_Categories_Registry::get_instance()->is_registered( 'featured' ) ) {
    108         register_block_pattern_category( 'featured', array( 'label' => __( 'Featured' ) ) );
    109106    }
    110107
Note: See TracChangeset for help on using the changeset viewer.