Automattic\WooCommerce\Internal\Features\ProductBlockEditor\ProductTemplates

ProductBlock{}WC 1.0

Class for Product block.

Хуков нет.

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

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

Методы

  1. public add_block( array $block_config )

Код ProductBlock{} WC 9.3.3

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 );
	}
}