Automattic\WooCommerce\Internal\StockNotifications
Telemetry::add_snapshot_to_tracker_data
Append the stock notifications snapshot to WC_Tracker's payload.
Params are untyped and coerced in the body because any third-party callback can pass a different value along the filter chain.
Method of the class: Telemetry{}
No Hooks.
Returns
mixed.
Usage
$Telemetry = new Telemetry(); $Telemetry->add_snapshot_to_tracker_data( $data );
- $data(mixed) (required)
- The aggregated tracker data.
Telemetry::add_snapshot_to_tracker_data() Telemetry::add snapshot to tracker data code WC 11.3.0
public function add_snapshot_to_tracker_data( $data ) {
if ( ! is_array( $data ) ) {
return $data;
}
$data['customer_stock_notifications'] = self::collect_snapshot();
return $data;
}