mirror of
git://develop.git.wordpress.org/
synced 2025-03-20 12:00:03 +01:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@52273 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a9e66f4bcb
commit
53bd78fd92
@ -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'] );
|
||||
|
Loading…
x
Reference in New Issue
Block a user