block_core_navigation_render_fallback
Filter HookDescription
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.Hook Information
File Location |
wp-includes/blocks/navigation.php
View on GitHub
|
Hook Type | Filter |
Line Number | 1099 |
Hook Parameters
Type | Name | Description |
---|---|---|
array[]
|
$fallback_blocks
|
default fallback blocks provided by the default block mechanic. |
Usage Examples
Basic Usage
<?php
// Hook into block_core_navigation_render_fallback
add_filter('block_core_navigation_render_fallback', 'my_custom_filter', 10, 1);
function my_custom_filter($fallback_blocks) {
// Your custom filtering logic here
return $fallback_blocks;
}
Source Code Context
wp-includes/blocks/navigation.php:1099
- How this hook is used in WordPress core
<?php
1094 *
1095 * @since 5.9.0
1096 *
1097 * @param array[] $fallback_blocks default fallback blocks provided by the default block mechanic.
1098 */
1099 return apply_filters( 'block_core_navigation_render_fallback', $fallback_blocks );
1100 }
1101
1102 /**
1103 * Iterate through all inner blocks recursively and get navigation link block's post IDs.
1104 *
PHP Documentation
<?php
/**
* 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[] $fallback_blocks default fallback blocks provided by the default block mechanic.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/blocks/navigation.php
Related Hooks
Related hooks will be displayed here in future updates.