WP_Navigation_Block_Renderer::does_block_need_a_list_item_wrapper()private staticWP 6.5.0

Returns whether or not a block needs a list item wrapper.

Метод класса: WP_Navigation_Block_Renderer{}

Хуки из метода

Возвращает

true|false. Returns whether or not a block needs a list item wrapper.

Использование

$result = WP_Navigation_Block_Renderer::does_block_need_a_list_item_wrapper( $block );
$block(WP_Block) (обязательный)
The block.

Список изменений

С версии 6.5.0 Введена.

Код WP_Navigation_Block_Renderer::does_block_need_a_list_item_wrapper() WP 6.7.1

private static function does_block_need_a_list_item_wrapper( $block ) {

	/**
	 * 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.
	 *
	 * @since 6.5.0
	 *
	 * @param array $needs_list_item_wrapper The list of blocks that need a list item wrapper.
	 * @return array The list of blocks that need a list item wrapper.
	 */
	$needs_list_item_wrapper = apply_filters( 'block_core_navigation_listable_blocks', static::$needs_list_item_wrapper );

	return in_array( $block->name, $needs_list_item_wrapper, true );
}