diff --git a/packages/block-library/src/navigation/index.php b/packages/block-library/src/navigation/index.php index dc65f619a9c8ac..1ee3aed730b8f0 100644 --- a/packages/block-library/src/navigation/index.php +++ b/packages/block-library/src/navigation/index.php @@ -272,8 +272,15 @@ function render_block_core_navigation( $attributes, $content, $block ) { $inner_blocks = $block->inner_blocks; - // If `__unstableLocation` is defined, create inner blocks from the classic menu assigned to that location. - if ( empty( $inner_blocks ) && array_key_exists( '__unstableLocation', $attributes ) ) { + // If `__unstableLocation` is defined and: + // - we have menu items at the defined location + // - we don't have a relationship to a `wp_navigation` Post (via `navigationMenuId`). + // ...then create inner blocks from the classic menu assigned to that location. + if ( + array_key_exists( '__unstableLocation', $attributes ) && + ! array_key_exists( 'navigationMenuId', $attributes ) && + ! empty( gutenberg_get_menu_items_at_location( $attributes['__unstableLocation'] ) ) + ) { $menu_items = gutenberg_get_menu_items_at_location( $attributes['__unstableLocation'] ); if ( empty( $menu_items ) ) { return '';