WC_Tracks_Client::queue_pixel_for_batch
Queue a pixel URL for batch sending.
Method of the class: WC_Tracks_Client{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = WC_Tracks_Client::queue_pixel_for_batch( $pixel ): void;
- $pixel(string) (required)
- The pixel URL to queue.
Changelog
| Since 10.5.0 | Introduced. |
WC_Tracks_Client::queue_pixel_for_batch() WC Tracks Client::queue pixel for batch code WC 10.5.0
private static function queue_pixel_for_batch( string $pixel ): void {
self::$pixel_batch_queue[] = $pixel;
// Register shutdown hook once.
if ( ! self::$shutdown_hook_registered ) {
add_action( 'shutdown', array( __CLASS__, 'send_batched_pixels' ), 20 );
self::$shutdown_hook_registered = true;
}
}