Automattic\WooCommerce\Admin\Features\OnboardingTasks

TaskList::possibly_track_completion()publicWC 1.0

Track list completion of viewable tasks.

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

No Hooks.

Return

null. Nothing.

Usage

$TaskList = new TaskList();
$TaskList->possibly_track_completion();

Code of TaskList::possibly_track_completion() WC 7.1.0

public function possibly_track_completion() {
	if ( ! $this->is_complete() ) {
		return;
	}

	if ( $this->has_previously_completed() ) {
		return;
	}

	$completed_lists   = get_option( self::COMPLETED_OPTION, array() );
	$completed_lists[] = $this->get_list_id();
	update_option( self::COMPLETED_OPTION, $completed_lists );
	$this->maybe_set_default_layout( $completed_lists );
	$this->record_tracks_event( 'tasks_completed' );
}