Skip to content

Commit

Permalink
Document the filter
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Nov 25, 2021
1 parent a720dbf commit b93b623
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/block-library/src/navigation/index.php
Expand Up @@ -207,6 +207,15 @@ function block_core_navigation_get_fallback_blocks() {
$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.
*
* @param array[] default fallback blocks provided by the default block mechanic.
*/
return apply_filters( 'block_core_navigation_render_fallback', $fallback_blocks );
}

Expand Down

0 comments on commit b93b623

Please sign in to comment.