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.

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

Хуков нет.

Возвращает

bool.

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

// private - только в коде основоного (родительского) класса
$result = $this->is_rendering_inside_add_to_cart_with_options(): bool;

Код ProductPageIntegration::is_rendering_inside_add_to_cart_with_options() 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'];
}