From 180aaf549db149be397569c6a3f0489c3bded9b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Tue, 23 Nov 2021 13:56:30 +0100 Subject: [PATCH] Ensure that blocks saved with the legacy ref attribute name (navigationMenuId) continue to render. --- packages/block-library/src/navigation/index.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/block-library/src/navigation/index.php b/packages/block-library/src/navigation/index.php index 390b2c32a3e0e..b65224f526830 100644 --- a/packages/block-library/src/navigation/index.php +++ b/packages/block-library/src/navigation/index.php @@ -275,6 +275,10 @@ function render_block_core_navigation( $attributes, $content, $block ) { } } + // Ensure that blocks saved with the legacy ref attribute name (navigationMenuId) continue to work. + if ( array_key_exists( 'navigationMenuId', $attributes ) ) { + $attributes['ref'] = $attributes['navigationMenuId']; + } // Load inner blocks from the navigation post. if ( array_key_exists( 'ref', $attributes ) ) { $navigation_post = get_post( $attributes['ref'] );