block_core_navigation_listable_blocks filter-hookWP 6.5.0

Filter the list of blocks that need a list item wrapper.

Affords the ability to customize which blocks need a list item wrapper when rendered within a core/navigation block. This is useful for blocks that are not list items but should be wrapped in a list item when used as a child of a navigation block.

Usage

add_filter( 'block_core_navigation_listable_blocks', 'wp_kama_block_core_navigation_listable_blocks_filter' );

/**
 * Function for `block_core_navigation_listable_blocks` filter-hook.
 * 
 * @param array $needs_list_item_wrapper The list of blocks that need a list item wrapper.
 *
 * @return array
 */
function wp_kama_block_core_navigation_listable_blocks_filter( $needs_list_item_wrapper ){

	// filter...
	return $needs_list_item_wrapper;
}
$needs_list_item_wrapper(array)
The list of blocks that need a list item wrapper.

Changelog

Since 6.5.0 Introduced.

Where the hook is called

WP_Navigation_Block_Renderer::does_block_need_a_list_item_wrapper()
block_core_navigation_listable_blocks
wp-includes/blocks/navigation.php 138
$needs_list_item_wrapper = apply_filters( 'block_core_navigation_listable_blocks', static::$needs_list_item_wrapper );

Where the hook is used in WordPress

Usage not found.