Skip to content

Commit

Permalink
move the check
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Dwyer committed Jan 20, 2023
1 parent 936b88d commit e703128
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/block-library/src/navigation/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,7 @@ function block_core_navigation_get_fallback_blocks() {
$fallback_blocks = ! empty( $maybe_fallback ) ? $maybe_fallback : $fallback_blocks;
}

if ( block_core_navigation_has_nested_core_navigation( $parsed_blocks ) ) {
return [];
}


/**
* Filters the fallback experience for the Navigation block.
Expand Down Expand Up @@ -646,6 +644,11 @@ function render_block_core_navigation( $attributes, $content, $block ) {
$inner_blocks = new WP_Block_List( $fallback_blocks, $attributes );
}

$parsed_blocks = parse_blocks( $navigation_post->post_content );
if ( block_core_navigation_has_nested_core_navigation( $parsed_blocks ) ) {
return '';
}

/**
* Filter navigation block $inner_blocks.
* Allows modification of a navigation block menu items.
Expand Down

0 comments on commit e703128

Please sign in to comment.