Automattic\WooCommerce\Admin\Features\OnboardingTasks

TaskLists::add_list()public staticWC 1.0

Add a task list.

Method of the class: TaskLists{}

No Hooks.

Return

\WP_Error|TaskList.

Usage

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

TaskLists::add_list() code WC 8.6.1

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'] ];
}