Automattic\WooCommerce\Internal\PushNotifications\Notifications

StockNotification::get_safety_net_argspublicWC 10.9.0

{@inheritDoc}

Appends event_type because it is part of this notification's identity (see {@see self::get_identifier()}): the same product can have distinct low_stock / out_of_stock / on_backorder safety nets pending at once, and the callback needs it to reconstruct the correct subtype.

stock_quantity_at_trigger is deliberately omitted — it is volatile payload data, not identity, and does not round-trip through every cancel path, so including it in the match key would risk breaking cancellation. The safety-net fallback message reads current product stock when it is absent (see {@see self::build_message()}).

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

Хуков нет.

Возвращает

Массив. mixed>

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

$StockNotification = new StockNotification();
$StockNotification->get_safety_net_args(): array;

Список изменений

С версии 10.9.0 Введена.

Код StockNotification::get_safety_net_args() WC 10.9.1

public function get_safety_net_args(): array {
	return array(
		$this->get_type(),
		$this->get_resource_id(),
		array( 'event_type' => $this->event_type ),
	);
}