Automattic\WooCommerce\Admin\Features\OnboardingTasks
TaskLists::add_list
Add a task list.
Method of the class: TaskLists{}
No Hooks.
Returns
\WP_Error|TaskList.
Usage
$result = TaskLists::add_list( $args );
- $args(array) (required)
- Task list properties.
TaskLists::add_list() TaskLists::add list code WC 10.4.3
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'] ];
}