Make WordPress Core


Ignore:
Timestamp:
02/08/2024 07:30:15 PM (22 months ago)
Author:
SergeyBiryukov
Message:

Twenty Twenty-Two: Prefix the pages block pattern category name.

If a plugin also registers the category name pages in an init hook that runs after the theme's, it can override the label and description unintentionally.

With a prefix, extenders can still override it, but it would be intentional.

Props poena, swissspidy, shailu25.
Fixes #59839.

File:
1 edited

Legend:

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

    r52392 r57569  
    1515function twentytwentytwo_register_block_patterns() {
    1616    $block_pattern_categories = array(
    17         'featured' => array( 'label' => __( 'Featured', 'twentytwentytwo' ) ),
    18         'footer'   => array( 'label' => __( 'Footers', 'twentytwentytwo' ) ),
    19         'header'   => array( 'label' => __( 'Headers', 'twentytwentytwo' ) ),
    20         'query'    => array( 'label' => __( 'Query', 'twentytwentytwo' ) ),
    21         'pages'    => array( 'label' => __( 'Pages', 'twentytwentytwo' ) ),
     17        'featured'              => array( 'label' => __( 'Featured', 'twentytwentytwo' ) ),
     18        'footer'                => array( 'label' => __( 'Footers', 'twentytwentytwo' ) ),
     19        'header'                => array( 'label' => __( 'Headers', 'twentytwentytwo' ) ),
     20        'query'                 => array( 'label' => __( 'Query', 'twentytwentytwo' ) ),
     21        'twentytwentytwo_pages' => array( 'label' => __( 'Pages', 'twentytwentytwo' ) ),
    2222    );
    2323
Note: See TracChangeset for help on using the changeset viewer.