Automattic\WooCommerce\Admin\Features\OnboardingTasks

Task::get_jsonpublicWC 1.0

Get the task as JSON.

Method of the class: Task{}

No Hooks.

Returns

Array.

Usage

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

Task::get_json() code WC 10.8.1

public function get_json() {
	$is_complete = $this->is_complete();
	if ( $is_complete ) {
		$this->possibly_track_completion();
	}

	return array(
		'id'              => $this->get_id(),
		'parentId'        => $this->get_parent_id(),
		'title'           => $this->get_title(),
		'badge'           => $this->get_badge(),
		'canView'         => $this->can_view(),
		'content'         => $this->get_content(),
		'additionalInfo'  => $this->get_additional_info(),
		'actionLabel'     => $this->get_action_label(),
		'actionUrl'       => $this->get_action_url(),
		'isComplete'      => $is_complete,
		'isInProgress'    => $this->is_in_progress(),
		'inProgressLabel' => $this->in_progress_label(),
		'time'            => $this->get_time(),
		'level'           => 3,
		'isActioned'      => $this->is_actioned(),
		'isDismissed'     => $this->is_dismissed(),
		'isDismissable'   => $this->is_dismissable(),
		'isSnoozed'       => false,
		'isSnoozeable'    => false,
		'isVisited'       => $this->is_visited(),
		'isDisabled'      => false,
		'snoozedUntil'    => null,
		'additionalData'  => self::convert_object_to_camelcase( $this->get_additional_data() ),
		'eventPrefix'     => $this->prefix_event( '' ),
		'recordViewEvent' => $this->get_record_view_event(),
	);
}