Automattic\WooCommerce\Blocks\BlockTypes\ProductCollection

Renderer::get_block_location_context │ private │ WC 1.0

Get the location context for a block, honoring a context-provided product reference before falling back to page-level detection.

Метод класса: Renderer{}

Хуков нет.

Возвращает

array. The location context.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->get_block_location_context( $context );
$context(массив) (обязательный)
The block context.

Код Renderer::get_block_location_context() WC 11.3.0

private function get_block_location_context( $context ) {
	if ( $this->context_provides_cart_reference( $context ) ) {
		return ProductCollectionUtils::get_cart_location_context();
	}

	return $this->get_location_context();
}