WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\Features

CustomerEffortScoreTracks::maybe_clear_ces_tracks_queue() public WC 1.0

Maybe clear the CES tracks queue, executed on every page load. If the clear option is set it clears the queue. In practice, this executes a page load after the queued CES tracks are displayed on the client, which sets the clear option.

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

No Hooks.

Return

null. Nothing.

Usage

$CustomerEffortScoreTracks = new CustomerEffortScoreTracks();
$CustomerEffortScoreTracks->maybe_clear_ces_tracks_queue();

Code of CustomerEffortScoreTracks::maybe_clear_ces_tracks_queue() WC 5.3.0

<?php
public function maybe_clear_ces_tracks_queue() {
	$clear_ces_tracks_queue_for_page = get_option(
		self::CLEAR_CES_TRACKS_QUEUE_FOR_PAGE_OPTION_NAME,
		false
	);

	if ( ! $clear_ces_tracks_queue_for_page ) {
		return;
	}

	$queue           = get_option(
		self::CES_TRACKS_QUEUE_OPTION_NAME,
		array()
	);
	$remaining_items = array_filter(
		$queue,
		function ( $item ) use ( $clear_ces_tracks_queue_for_page ) {
			return $clear_ces_tracks_queue_for_page['pagenow'] !== $item['pagenow']
			|| $clear_ces_tracks_queue_for_page['adminpage'] !== $item['adminpage'];
		}
	);

	update_option(
		self::CES_TRACKS_QUEUE_OPTION_NAME,
		array_values( $remaining_items )
	);
	update_option( self::CLEAR_CES_TRACKS_QUEUE_FOR_PAGE_OPTION_NAME, false );
}