WooCommerce Code Reference

ContainerInterface

Interface for block containers.

Table of Contents

get_block()  : BlockInterface|null
Get a block by ID.
get_formatted_template()  : array<string|int, mixed>
Get the block configuration as a formatted template.
get_root_template()  : BlockTemplateInterface
Get the root template that the block belongs to.
remove_block()  : mixed
Removes a block from the container.
remove_blocks()  : mixed
Removes all blocks from the container.

Methods

remove_block()

Removes a block from the container.

public remove_block(string $block_id) : mixed
Parameters
$block_id : string

The block ID.

Tags
throws
UnexpectedValueException

If the block container is not an ancestor of the block.

Return values
mixed