WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
класс не описан

WC_Status_Tracking{} WC 1.0

This class adds actions to track usage of WooCommerce Orders.

Хуков нет.

Возвращает

Null. Ничего.

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

$WC_Status_Tracking = new WC_Status_Tracking();
// use class methods

Методы

  1. init()
  2. track_status_view()

Код WC_Status_Tracking{} WC 4.5.2

woocommerce/includes/tracks/events/class-wc-status-tracking.php
<?php
class WC_Status_Tracking {
	/**
	 * Init tracking.
	 */
	public function init() {
		add_action( 'admin_init', array( $this, 'track_status_view' ), 10 );
	}

	/**
	 * Add Tracks events to the status page.
	 */
	public function track_status_view() {
		if ( isset( $_GET['page'] ) && 'wc-status' === sanitize_text_field( wp_unslash( $_GET['page'] ) ) ) {

			$tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'status';

			WC_Tracks::record_event(
				'status_view',
				array(
					'tab'       => $tab,
					'tool_used' => isset( $_GET['action'] ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : null,
				)
			);

			if ( 'status' === $tab ) {
				wc_enqueue_js(
					"
					$( 'a.debug-report' ).click( function() {
						window.wcTracks.recordEvent( 'status_view_reports' );
					} );
				"
				);
			}
		}
	}
}