Make WordPress Core


Ignore:
Timestamp:
11/29/2021 11:29:52 PM (3 years ago)
Author:
noisysocks
Message:

Restore block PHP to canonical version in @wordpress/block-library

r52272 erroneously modified src/wp-includes/blocks/navigation.php. This file
is copied from @wordpress/block-library and so must be updated via npm. This
commit restores the file by running grunt build --dev.

Follows [52272].
See #54506.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks/navigation.php

    r52272 r52273  
    182182        $parsed_blocks           = gutenberg_parse_blocks_from_menu_items( $menu_items_by_parent_id[0], $menu_items_by_parent_id );
    183183        $inner_blocks            = new WP_Block_List( $parsed_blocks, $attributes );
     184    }
     185
     186    if ( ! empty( $block->context['navigationArea'] ) ) {
     187        $area    = $block->context['navigationArea'];
     188        $mapping = get_option( 'wp_navigation_areas', array() );
     189        if ( ! empty( $mapping[ $area ] ) ) {
     190            $attributes['navigationMenuId'] = $mapping[ $area ];
     191        }
    184192    }
    185193
Note: See TracChangeset for help on using the changeset viewer.