Automattic\WooCommerce\Blocks\Templates

ArchiveProductTemplatesCompatibility::is_product_collection_block_with_inherit_query()privateWC 1.0

Check if the block is a Product Collection block that inherits query from template.

Method of the class: ArchiveProductTemplatesCompatibility{}

No Hooks.

Return

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->is_product_collection_block_with_inherit_query( $block );
$block(array) (required)
Parsed block data.

ArchiveProductTemplatesCompatibility::is_product_collection_block_with_inherit_query() code WC 9.0.1

private function is_product_collection_block_with_inherit_query( $block ) {
	return 'woocommerce/product-collection' === $block['blockName'] &&
	isset( $block['attrs']['query']['inherit'] ) &&
	$block['attrs']['query']['inherit'];
}