Make WordPress Core

Changeset 61609


Ignore:
Timestamp:
02/10/2026 04:36:25 PM (8 months ago)
Author:
scruffian
Message:

Editor: Navigation overlay - patterns and template part definition.

Adds a new template part for the Navigation block called WP_TEMPLATE_PART_AREA_NAVIGATION_OVERLAY, corresponding area definition in block-template-utils.php to support navigation overlay template parts.

Also adds the navigation block pattern category registration in block-patterns.php and five new navigation overlay block patterns.

Reviewed by mikachan, get_dave.

Props onemaggie, scruffian, get_dave, mikachan, wildworks.
Fixes #64589.

Location:
trunk/src/wp-includes
Files:
5 added
2 edited

Legend:

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

    r61348 r61609  
    8080                        'query-large-title-posts',
    8181                        'query-offset-posts',
     82                        'navigation-overlay',
     83                        'navigation-overlay-black-bg',
     84                        'navigation-overlay-accent-bg',
     85                        'navigation-overlay-centered',
     86                        'navigation-overlay-centered-with-extras',
    8287                );
    8388
    … …  
    227232                        'label'       => _x( 'Headers', 'Block pattern category' ),
    228233                        'description' => __( 'A variety of header designs displaying your site title and navigation.' ),
     234                )
     235        );
     236        register_block_pattern_category(
     237                'navigation',
     238                array(
     239                        'label'       => _x( 'Navigation', 'Block pattern category' ),
     240                        'description' => __( 'A variety of designs displaying site navigation.' ),
    229241                )
    230242        );
  • trunk/src/wp-includes/block-template-utils.php

    r61431 r61609  
    1919if ( ! defined( 'WP_TEMPLATE_PART_AREA_UNCATEGORIZED' ) ) {
    2020        define( 'WP_TEMPLATE_PART_AREA_UNCATEGORIZED', 'uncategorized' );
     21}
     22if ( ! defined( 'WP_TEMPLATE_PART_AREA_NAVIGATION_OVERLAY' ) ) {
     23        define( 'WP_TEMPLATE_PART_AREA_NAVIGATION_OVERLAY', 'navigation-overlay' );
    2124}
    2225
    … …  
    9699                        'icon'        => 'footer',
    97100                        'area_tag'    => 'footer',
     101                ),
     102                array(
     103                        'area'        => WP_TEMPLATE_PART_AREA_NAVIGATION_OVERLAY,
     104                        'label'       => _x( 'Navigation Overlay', 'template part area' ),
     105                        'description' => __(
     106                                'The Navigation Overlay template defines a full-screen overlay area that typically contains navigation links and can be toggled on and off.'
     107                        ),
     108                        'icon'        => 'overlay',
     109                        'area_tag'    => 'div',
    98110                ),
    99111        );
Note: See TracChangeset for help on using the changeset viewer.