block_core_navigation_render_fallback
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.
Usage
add_filter( 'block_core_navigation_render_fallback', 'wp_kama_block_core_navigation_render_fallback_filter' ); /** * Function for `block_core_navigation_render_fallback` filter-hook. * * @param array[] $fallback_blocks default fallback blocks provided by the default block mechanic. * * @return array[] */ function wp_kama_block_core_navigation_render_fallback_filter( $fallback_blocks ){ // filter... return $fallback_blocks; }
- $fallback_blocks(array[])
- default fallback blocks provided by the default block mechanic.
Changelog
Since 5.9.0 | Introduced. |
Where the hook is called
block_core_navigation_render_fallback
wp-includes/blocks/navigation.php 1094
return apply_filters( 'block_core_navigation_render_fallback', $fallback_blocks );