Automattic\WooCommerce\Admin\Features\OnboardingTasks

TaskLists::init_default_lists()public staticWC 1.0

Initialize default lists.

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

Хуков нет.

Возвращает

null. Ничего.

Использование

$result = TaskLists::init_default_lists();

Код TaskLists::init_default_lists() WC 7.3.0

public static function init_default_lists() {
	self::add_list(
		array(
			'id'                      => 'setup',
			'title'                   => __( 'Get ready to start selling', 'woocommerce' ),
			'tasks'                   => array(
				'StoreDetails',
				'Purchase',
				'Products',
				'WooCommercePayments',
				'Payments',
				'Tax',
				'Shipping',
				'Marketing',
				'Appearance',
			),
			'display_progress_header' => true,
			'event_prefix'            => 'tasklist_',
			'options'                 => array(
				'use_completed_title' => true,
			),
			'visible'                 => true,
		)
	);

	self::add_list(
		array(
			'id'      => 'extended',
			'title'   => __( 'Things to do next', 'woocommerce' ),
			'sort_by' => array(
				array(
					'key'   => 'is_complete',
					'order' => 'asc',
				),
				array(
					'key'   => 'level',
					'order' => 'asc',
				),
			),
			'tasks'   => array(
				'AdditionalPayments',
				'GetMobileApp',
			),
		)
	);
	self::add_list(
		array(
			'id'           => 'setup_two_column',
			'hidden_id'    => 'setup',
			'title'        => __( 'Get ready to start selling', 'woocommerce' ),
			'tasks'        => array(
				'Products',
				'WooCommercePayments',
				'Payments',
				'Tax',
				'Shipping',
				'Marketing',
				'Appearance',
			),
			'event_prefix' => 'tasklist_',
		)
	);
	self::add_list(
		array(
			'id'           => 'extended_two_column',
			'hidden_id'    => 'extended',
			'title'        => __( 'Things to do next', 'woocommerce' ),
			'sort_by'      => array(
				array(
					'key'   => 'is_complete',
					'order' => 'asc',
				),
				array(
					'key'   => 'level',
					'order' => 'asc',
				),
			),
			'tasks'        => array(
				'AdditionalPayments',
				'GetMobileApp',
			),
			'event_prefix' => 'extended_tasklist_',
		)
	);

	if ( Features::is_enabled( 'shipping-smart-defaults' ) ) {
		self::add_task(
			'extended',
			new ReviewShippingOptions(
				self::get_list( 'extended' )
			)
		);

		self::add_task(
			'extended_two_column',
			new ReviewShippingOptions(
				self::get_list( 'extended_two_column' )
			)
		);

		// Tasklist that will never be shown in homescreen,
		// used for having tasks that are accessed by other means.
		self::add_list(
			array(
				'id'           => 'secret_tasklist',
				'hidden_id'    => 'setup',
				'tasks'        => array(
					'ExperimentalShippingRecommendation',
				),
				'event_prefix' => 'secret_tasklist_',
				'visible'      => false,
			)
		);
	}

	if ( ! wp_is_mobile() ) { // Permit In-App Marketplace Tour on desktops only.
		$tour_task = new TourInAppMarketplace();
		self::add_task( 'extended', $tour_task );
		self::add_task( 'extended_two_column', $tour_task );
	}
}