Automattic\WooCommerce\Admin\Features\OnboardingTasks

TaskList::get_json()publicWC 1.0

Get the list for use in JSON.

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

No Hooks.

Return

Array.

Usage

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

Код TaskList::get_json() WC 7.1.0

public function get_json() {
	$this->possibly_track_completion();
	$tasks_json = array();
	foreach ( $this->tasks as $task ) {
		$json = $task->get_json();
		if ( $json['canView'] ) {
			$tasks_json[] = $json;
		}
	}

	return array(
		'id'                    => $this->get_list_id(),
		'title'                 => $this->title,
		'isHidden'              => $this->is_hidden(),
		'isVisible'             => $this->is_visible(),
		'isComplete'            => $this->is_complete(),
		'tasks'                 => $tasks_json,
		'eventPrefix'           => $this->prefix_event( '' ),
		'displayProgressHeader' => $this->display_progress_header,
		'keepCompletedTaskList' => $this->get_keep_completed_task_list(),
		'sections'              => array_map(
			function( $section ) {
				return $section->get_json();
			},
			$this->sections
		),
	);
}