WordPress at Your Fingertips
function is not described

WC_Status_Tracking::track_status_view() public WC 1.0

Add Tracks events to the status page.

{} It's a method of the class: WC_Status_Tracking{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Status_Tracking = new WC_Status_Tracking();
$WC_Status_Tracking->track_status_view();

Code of WC_Status_Tracking::track_status_view() WC 5.8.0

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' ).on( 'click', function() {
					window.wcTracks.recordEvent( 'status_view_reports' );
				} );
			"
			);
		}
	}
}