Automattic\WooCommerce\Admin\Features\OnboardingTasks

Task::possibly_track_completion()publicWC 1.0

Track task completion if task is viewable.

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

No Hooks.

Return

null. Nothing.

Usage

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

Code of Task::possibly_track_completion() WC 6.9.4

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

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

	$completed_tasks   = get_option( self::COMPLETED_OPTION, array() );
	$completed_tasks[] = $this->get_id();
	update_option( self::COMPLETED_OPTION, $completed_tasks );
	$this->record_tracks_event( 'task_completed', array( 'task_name' => $this->get_id() ) );
}