Automattic\WooCommerce\Admin\Features\OnboardingTasks

TaskLists::maybe_add_extended_tasks()public staticWC 1.0

Add default extended task lists.

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

No Hooks.

Return

null. Nothing.

Usage

$result = TaskLists::maybe_add_extended_tasks( $extended_tasks );
$extended_tasks(array) (required)
list of extended tasks.

Code of TaskLists::maybe_add_extended_tasks() WC 6.8.2

public static function maybe_add_extended_tasks( $extended_tasks ) {
	$tasks = $extended_tasks ?? array();

	foreach ( self::$lists as $task_list ) {
		if ( 'extended' !== substr( $task_list->id, 0, 8 ) ) {
			continue;
		}
		foreach ( $tasks as $args ) {
			$task = new DeprecatedExtendedTask( $task_list, $args );
			$task_list->add_task( $task );
		}
	}

}