Automattic\WooCommerce\Internal\Admin

CustomerEffortScoreTracks::enqueue_to_ces_tracks()privateWC 1.0

Enqueue the item to the CES tracks queue.

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

Хуков нет.

Возвращает

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

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

// private - только в коде основоного (родительского) класса
$result = $this->enqueue_to_ces_tracks( $item );
$item(массив) (обязательный)
The item to enqueue.

Код CustomerEffortScoreTracks::enqueue_to_ces_tracks() WC 8.7.0

private function enqueue_to_ces_tracks( $item ) {
	$queue = get_option(
		self::CES_TRACKS_QUEUE_OPTION_NAME,
		array()
	);

	$has_duplicate = array_filter(
		$queue,
		function ( $queue_item ) use ( $item ) {
			return $queue_item['action'] === $item['action'];
		}
	);
	if ( $has_duplicate ) {
		return;
	}

	$queue[] = $item;

	update_option(
		self::CES_TRACKS_QUEUE_OPTION_NAME,
		$queue
	);
}