render_block_core_navigation_link_allowed_post_status
Filter allowed post_status for navigation link block to render.
Usage
add_filter( 'render_block_core_navigation_link_allowed_post_status', 'wp_kama_render_block_core_navigation_link_allowed_post_status_filter', 10, 3 );
/**
* Function for `render_block_core_navigation_link_allowed_post_status` filter-hook.
*
* @param array $post_status Array of allowed post statuses.
* @param array $attributes Block attributes.
* @param WP_Block $block The parsed block.
*
* @return array
*/
function wp_kama_render_block_core_navigation_link_allowed_post_status_filter( $post_status, $attributes, $block ){
// filter...
return $post_status;
}
- $post_status(array)
- Array of allowed post statuses.
- $attributes(array)
- Block attributes.
- $block(WP_Block)
- The parsed block.
Changelog
| Since 6.8.0 | Introduced. |
Where the hook is called
render_block_core_navigation_link_allowed_post_status
wp-includes/blocks/navigation-link/shared/item-should-render.php 34-39
$allowed_post_status = (array) apply_filters( 'render_block_core_navigation_link_allowed_post_status', array( 'publish' ), $attributes, $block );