array
( 'blockName' => 'core/page-list',
),
);
$registry = WP_Block_Type_Registry::
get_instance();
// 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.