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.
{} Это метод класса: CustomerEffortScoreTracks{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
$CustomerEffortScoreTracks = new CustomerEffortScoreTracks(); $CustomerEffortScoreTracks->maybe_clear_ces_tracks_queue();
Код CustomerEffortScoreTracks::maybe_clear_ces_tracks_queue() CustomerEffortScoreTracks::maybe clear ces tracks queue WC 5.2.2
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 );
}