Server IP : 172.67.158.161 / Your IP : 3.133.142.103 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/giankuin/khowordpress.com/wp-content/plugins/woocommerce/src/Internal/Features/ProductBlockEditor/ProductTemplates/ |
Upload File : |
<?php /** * WooCommerce Section Block class. */ namespace Automattic\WooCommerce\Internal\Admin\Features\ProductBlockEditor\ProductTemplates; use Automattic\WooCommerce\Admin\BlockTemplates\BlockTemplateInterface; use Automattic\WooCommerce\Admin\BlockTemplates\ContainerInterface; use Automattic\WooCommerce\Admin\Features\ProductBlockEditor\ProductTemplates\SectionInterface; use Automattic\WooCommerce\Admin\Features\ProductBlockEditor\ProductTemplates\SubsectionInterface; /** * Class for Section block. */ class Section extends ProductBlock implements SectionInterface { // phpcs:disable Squiz.Commenting.FunctionCommentThrowTag.WrongNumber /** * Section Block constructor. * * @param array $config The block configuration. * @param BlockTemplateInterface $root_template The block template that this block belongs to. * @param ContainerInterface|null $parent The parent block container. * * @throws \ValueError If the block configuration is invalid. * @throws \ValueError If the parent block container does not belong to the same template as the block. * @throws \InvalidArgumentException If blockName key and value are passed into block configuration. */ public function __construct( array $config, BlockTemplateInterface &$root_template, ContainerInterface &$parent = null ) { if ( ! empty( $config['blockName'] ) ) { throw new \InvalidArgumentException( 'Unexpected key "blockName", this defaults to "woocommerce/product-section".' ); } parent::__construct( array_merge( array( 'blockName' => 'woocommerce/product-section' ), $config ), $root_template, $parent ); } // phpcs:enable Squiz.Commenting.FunctionCommentThrowTag.WrongNumber /** * Add a sub-section block type to this template. * * @param array $block_config The block data. */ public function add_subsection( array $block_config ): SubsectionInterface { $block = new Subsection( $block_config, $this->get_root_template(), $this ); return $this->add_inner_block( $block ); } /** * Add a sub-section block type to this template. * * @deprecated 8.6.0 * * @param array $block_config The block data. */ public function add_section( array $block_config ): SubsectionInterface { wc_deprecated_function( 'add_section', '8.6.0', 'add_subsection' ); return $this->add_subsection( $block_config ); } }