WC_Tracks_Footer_Pixel::render_tracking_pixels()publicWC 1.0

Add events as tracking pixels to page footer.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$WC_Tracks_Footer_Pixel = new WC_Tracks_Footer_Pixel();
$WC_Tracks_Footer_Pixel->render_tracking_pixels();

Код WC_Tracks_Footer_Pixel::render_tracking_pixels() WC 8.7.0

public function render_tracking_pixels() {
	if ( empty( $this->events ) ) {
		return;
	}

	foreach ( $this->events as $event ) {
		$pixel = $event->build_pixel_url();

		if ( ! $pixel ) {
			continue;
		}

		echo '<img style="position: fixed;" src="', esc_url( $pixel ), '" />';
	}

	$this->events = array();
}