Automattic\WooCommerce\Internal\Admin
CustomerEffortScoreTracks::enqueue_to_ces_tracks
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() CustomerEffortScoreTracks::enqueue to ces tracks WC 10.4.0
private function enqueue_to_ces_tracks( $item ) {
$queue = get_option(
self::CES_TRACKS_QUEUE_OPTION_NAME,
array()
);
$queue = is_array( $queue ) ? $queue : 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
);
}