Automattic\WooCommerce\Admin\Features\OnboardingTasks

TaskLists::add_list()public staticWC 1.0

Add a task list.

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

No Hooks.

Return

WP_Error|TaskList.

Usage

$result = TaskLists::add_list( $args );
$args(array) (required)
Task list properties.

Code of TaskLists::add_list() WC 6.8.2

public static function add_list( $args ) {
	if ( isset( self::$lists[ $args['id'] ] ) ) {
		return new \WP_Error(
			'woocommerce_task_list_exists',
			__( 'Task list ID already exists', 'woocommerce' )
		);
	}

	self::$lists[ $args['id'] ] = new TaskList( $args );
	return self::$lists[ $args['id'] ];
}