// If `core/page-list` is not registered then return empty blocks.
$fallback_blocks =
$registry->
is_registered( 'core/page-list'
) ?
$page_list_fallback : array
();
if ( class_exists( 'WP_Navigation_Fallback'
) ) { $navigation_post = WP_Navigation_Fallback::
get_fallback();
} else { $navigation_post = Gutenberg_Navigation_Fallback::
get_fallback();
} // Use the first non-empty Navigation as fallback if available.
if ( $navigation_post ) { $parsed_blocks =
parse_blocks( $navigation_post->post_content
);
$maybe_fallback =
block_core_navigation_filter_out_empty_blocks( $parsed_blocks );
// Normalizing blocks may result in an empty array of blocks if they were all `null` blocks.
// In this case default to the (Page List) fallback.
$fallback_blocks = !
empty( $maybe_fallback ) ?
$maybe_fallback :
$fallback_blocks;
} /**
* Filters the fallback experience for the Navigation block.
*
* Returning a falsey value will opt out of the fallback and cause the block not to render.
* To customise the blocks provided return an array of blocks - these should be valid
* children of the `core/navigation` block.
*
* @since 5.9.0
*
* @param array[] default fallback blocks provided by the default block mechanic.
*/