Automattic\WooCommerce\Admin\Features\OnboardingTasks
Task::possibly_track_completion
Track task completion if task is viewable and is complete.
Method of the class: Task{}
No Hooks.
Returns
null. Nothing (null).
Usage
$Task = new Task(); $Task->possibly_track_completion();
Task::possibly_track_completion() Task::possibly track completion code WC 10.5.0
public function possibly_track_completion() {
if ( $this->has_previously_completed() ) {
return;
}
// Expensive check.
if ( ! $this->is_complete() ) {
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() ) );
}