Automattic\WooCommerce\Internal\PushNotifications\Notifications
StockNotification::get_safety_net_args
{@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()}).
Method of the class: StockNotification{}
No Hooks.
Returns
Array
Usage
$StockNotification = new StockNotification(); $StockNotification->get_safety_net_args(): array;
Changelog
| Since 10.9.0 | Introduced. |
StockNotification::get_safety_net_args() StockNotification::get safety net args code 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 ),
);
}