Automattic\WooCommerce\Internal\Features\ProductBlockEditor\ProductTemplates

ProductBlock{}WC 1.0└─ ContainerInterface, AbstractBlock

Class for Product block.

No Hooks.

Usage

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

Methods

  1. public add_block( array $block_config )

ProductBlock{} code WC 10.7.0

class ProductBlock extends AbstractBlock implements ContainerInterface {
	use BlockContainerTrait;
	/**
	 * Adds block to the section block.
	 *
	 * @param array $block_config The block data.
	 */
	public function &add_block( array $block_config ): BlockInterface {
		$block = new ProductBlock( $block_config, $this->get_root_template(), $this );
		return $this->add_inner_block( $block );
	}
}