Automattic\WooCommerce\Blocks\BlockTypes\ProductCollection

Renderer::context_provides_cart_reference │ private │ WC 1.0

Whether the given block context provides a cart product reference (see the PRODUCT_REFERENCE_CONTEXT constant).

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

Хуков нет.

Возвращает

bool.

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

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

Код Renderer::context_provides_cart_reference() WC 11.3.0

private function context_provides_cart_reference( $context ) {
	return self::REFERENCE_TYPE_CART === ( $context[ self::PRODUCT_REFERENCE_CONTEXT ] ?? null );
}