Automattic\WooCommerce\Admin\Features\ProductBlockEditor\ProductTemplates
SectionInterface{}└─ BlockContainerInterface
Deprecated since 10.9.0 Product editor extension APIs will be removed in WooCommerce 11.0.. It is no longer supported and may be removed in future releases. It is recommended to replace this function with the same one.
Interface for section containers, which contain sub-sections and blocks.
No Hooks.
Usage
$SectionInterface = new SectionInterface(); // use class methods
Methods
- public add_block( array $block_config )
- public add_section( array $block_config )
- public add_subsection( array $block_config )
Changelog
| Deprecated since 10.9.0 | Product editor extension APIs will be removed in WooCommerce 11.0. |
SectionInterface{} SectionInterface{} code WC 10.9.1
interface SectionInterface extends BlockContainerInterface {
/**
* Adds a new sub-section to the section.
*
* @param array $block_config block config.
* @return SubsectionInterface new block sub-section.
*/
public function add_subsection( array $block_config ): SubsectionInterface;
/**
* Adds a new block to the section.
*
* @param array $block_config block config.
*/
public function add_block( array $block_config ): BlockInterface;
/**
* Adds a new sub-section to the section.
*
* @deprecated 8.6.0
*
* @param array $block_config The block data.
*/
public function add_section( array $block_config ): SubsectionInterface;
}