Automattic\WooCommerce\Blocks\Templates

ArchiveProductTemplatesCompatibility::inner_blocks_walker()privateWC 1.0

Loop through inner blocks recursively to find the Products blocks 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->inner_blocks_walker( $block );
$block(array) (required) (passed by reference — &)
Parsed block data.

ArchiveProductTemplatesCompatibility::inner_blocks_walker() code WC 9.0.1

private function inner_blocks_walker( &$block ) {
	if (
		$this->is_products_block_with_inherit_query( $block ) || $this->is_product_collection_block_with_inherit_query( $block )
	) {
		$this->inject_attribute( $block );
		$this->remove_default_hooks();
	}

	if ( ! empty( $block['innerBlocks'] ) ) {
		array_walk( $block['innerBlocks'], array( $this, 'inner_blocks_walker' ) );
	}
}