Skip to content

Commit

Permalink
Ensure that blocks saved with the legacy ref attribute name (navigati…
Browse files Browse the repository at this point in the history
…onMenuId) continue to render.
  • Loading branch information
adamziel committed Nov 25, 2021
1 parent 3faab90 commit 180aaf5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/block-library/src/navigation/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] );
Expand Down

0 comments on commit 180aaf5

Please sign in to comment.