WooCommerce Code Reference

TaskLists
in package

Task Lists class.

Table of Contents

DEFAULT_TASKS  = array('StoreDetails', 'Products', 'WooCommercePayments', 'Payments', 'Tax', 'Shipping', 'Marketing', 'Appearance', 'AdditionalPayments', 'ReviewShippingOptions', 'GetMobileApp')
The contents of this array is used in init_tasks() to run their init() methods.
$default_tasks_loaded  : bool
Boolean value to indicate if default tasks have been added.
$instance  : TaskLists
Class instance.
$lists  : array<string|int, mixed>
An array of all registered lists.
add_list()  : WP_Error|TaskList
Add a task list.
add_task()  : WP_Error|Task
Add task to a given task list.
clear_lists()  : mixed
Clear all task lists.
get_list()  : TaskList|null
Retrieve a task list by ID.
get_list_ids()  : array<string|int, mixed>
Get all task list ids.
get_lists()  : array<string|int, mixed>
Get all task lists.
get_lists_by_ids()  : array<string|int, mixed>
Get all task lists.
get_task()  : object
Retrieve single task.
get_visible()  : mixed
Get visible task lists.
init()  : mixed
Initialize the task lists.
init_default_lists()  : mixed
Initialize default lists.
init_tasks()  : mixed
Initialize tasks.
instance()  : mixed
Get class instance.
is_experiment_treatment()  : bool
Check if an experiment is the treatment or control.
maybe_add_extended_tasks()  : mixed
Add default extended task lists.
menu_task_count()  : mixed
Add badge to homescreen menu item for remaining tasks
set_active_task()  : mixed
Temporarily store the active task to persist across page loads when necessary.
setup_tasks_remaining()  : number
Return number of setup tasks remaining
task_list_preloaded_settings()  : array<string|int, mixed>
Add visible list ids to component settings.

Constants

DEFAULT_TASKS

The contents of this array is used in init_tasks() to run their init() methods.

public array<string|int, mixed> DEFAULT_TASKS = array('StoreDetails', 'Products', 'WooCommercePayments', 'Payments', 'Tax', 'Shipping', 'Marketing', 'Appearance', 'AdditionalPayments', 'ReviewShippingOptions', 'GetMobileApp')

If the classes do not have an init() method then nothing is executed. Beyond that, adding tasks to this list has no effect, see init_default_lists() for the list of tasks. that are added for each task list.

Properties

Methods

get_lists_by_ids()

Get all task lists.

public static get_lists_by_ids(array<string|int, mixed> $ids) : array<string|int, mixed>
Parameters
$ids : array<string|int, mixed>

list of task list ids.

Return values
array<string|int, mixed>

get_task()

Retrieve single task.

public static get_task(string $id[, string $task_list_id = null ]) : object
Parameters
$id : string

Task ID.

$task_list_id : string = null

Task list ID.

Return values
object

is_experiment_treatment()

Check if an experiment is the treatment or control.

public static is_experiment_treatment(string $name) : bool
Parameters
$name : string

Name prefix of experiment.

Return values
bool

maybe_add_extended_tasks()

Add default extended task lists.

public static maybe_add_extended_tasks(array<string|int, mixed> $extended_tasks) : mixed
Parameters
$extended_tasks : array<string|int, mixed>

list of extended tasks.

Return values
mixed

set_active_task()

Temporarily store the active task to persist across page loads when necessary.

public static set_active_task() : mixed

Most tasks do not need this.

Return values
mixed

task_list_preloaded_settings()

Add visible list ids to component settings.

public static task_list_preloaded_settings(array<string|int, mixed> $settings) : array<string|int, mixed>
Parameters
$settings : array<string|int, mixed>

Component settings.

Return values
array<string|int, mixed>