Automattic\WooCommerce\Admin\BlockTemplates

ContainerInterface{}interfaceWC 1.0

Interface for block containers.

Хуков нет.

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

$ContainerInterface = new ContainerInterface();
// use class methods

Методы

  1. public get_block( string $block_id )
  2. public get_formatted_template()
  3. public get_root_template()
  4. public remove_block( string $block_id )
  5. public remove_blocks()
  6. ERROR: no method name found on line `* @param string $block_id The block ID.`
  7. ERROR: no method name found on line `/**`

Код ContainerInterface{} WC 10.4.0

interface ContainerInterface {
	/**
	 * Get the root template that the block belongs to.
	 */
	public function &get_root_template(): BlockTemplateInterface;

	/**
	 * Get the block configuration as a formatted template.
	 */
	public function get_formatted_template(): array;

	/**
	 * Get a block by ID.
	 *
	 * @param string $block_id The block ID.
	 */
	public function get_block( string $block_id ): ?BlockInterface;

	/**
	 * Removes a block from the container.
	 *
	 * @param string $block_id The block ID.
	 *
	 * @throws \UnexpectedValueException If the block container is not an ancestor of the block.
	 */
	public function remove_block( string $block_id );

	/**
	 * Removes all blocks from the container.
	 */
	public function remove_blocks();
}