From 57aee3ba4d59f6fa37fbdd1d88808ccd24bf42e0 Mon Sep 17 00:00:00 2001 From: noisysocks Date: Mon, 29 Nov 2021 23:31:05 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@52273 git-svn-id: http://core.svn.wordpress.org/trunk@51865 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/blocks/navigation.php | 8 ++++++++ wp-includes/version.php | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/wp-includes/blocks/navigation.php b/wp-includes/blocks/navigation.php index 71c999e4a5..e3848190c6 100644 --- a/wp-includes/blocks/navigation.php +++ b/wp-includes/blocks/navigation.php @@ -183,6 +183,14 @@ function render_block_core_navigation( $attributes, $content, $block ) { $inner_blocks = new WP_Block_List( $parsed_blocks, $attributes ); } + if ( ! empty( $block->context['navigationArea'] ) ) { + $area = $block->context['navigationArea']; + $mapping = get_option( 'wp_navigation_areas', array() ); + if ( ! empty( $mapping[ $area ] ) ) { + $attributes['navigationMenuId'] = $mapping[ $area ]; + } + } + // Load inner blocks from the navigation post. if ( array_key_exists( 'navigationMenuId', $attributes ) ) { $navigation_post = get_post( $attributes['navigationMenuId'] ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 9d365c4f7a..7d875e9b94 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-alpha-52272'; +$wp_version = '5.9-alpha-52273'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.