Automattic\WooCommerce\Blocks\Templates

ArchiveProductTemplatesCompatibility::is_block_within_namespace()privateWC 1.0

Check if block is within the product-query namespace

Method of the class: ArchiveProductTemplatesCompatibility{}

No Hooks.

Return

null. Nothing (null).

Usage

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

ArchiveProductTemplatesCompatibility::is_block_within_namespace() code WC 9.0.1

private function is_block_within_namespace( $block ) {
	$attributes = $block['attrs'];

	return isset( $attributes['__woocommerceNamespace'] ) && 'woocommerce/product-query/product-template' === $attributes['__woocommerceNamespace'];
}