Automattic\WooCommerce\Internal\StockNotifications\Frontend

ProductPageIntegration::is_rendering_inside_add_to_cart_with_options │ private │ WC 1.0

Whether the hook is firing from inside the Add to Cart + Options render callback.

WP_Block::render() sets WP_Block_Supports::$block_to_render around the callback, and the block fires its buffered template hooks before rendering inner blocks.

Method of the class: ProductPageIntegration{}

No Hooks.

Returns

bool.

Usage

// private - for code of main (parent) class only
$result = $this->is_rendering_inside_add_to_cart_with_options(): bool;

ProductPageIntegration::is_rendering_inside_add_to_cart_with_options() code WC 11.2.2

private function is_rendering_inside_add_to_cart_with_options(): bool {
	return isset( \WP_Block_Supports::$block_to_render['blockName'] )
		&& self::ADD_TO_CART_WITH_OPTIONS_BLOCK === \WP_Block_Supports::$block_to_render['blockName'];
}