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
$default_tasks_loaded
Boolean value to indicate if default tasks have been added.
protected
static bool
$default_tasks_loaded
= false
$instance
Class instance.
protected
static TaskLists
$instance
= null
$lists
An array of all registered lists.
protected
static array<string|int, mixed>
$lists
= array()
Methods
add_list()
Add a task list.
public
static add_list(array<string|int, mixed> $args) : WP_Error|TaskList
Parameters
- $args : array<string|int, mixed>
-
Task list properties.
Return values
WP_Error|TaskList —add_task()
Add task to a given task list.
public
static add_task(string $list_id, Task $task) : WP_Error|Task
Parameters
- $list_id : string
-
List ID to add the task to.
- $task : Task
-
Task object.
Return values
WP_Error|Task —clear_lists()
Clear all task lists.
public
static clear_lists() : mixed
Return values
mixed —get_list()
Retrieve a task list by ID.
public
static get_list(string $id) : TaskList|null
Parameters
- $id : string
-
Task list ID.
Return values
TaskList|null —get_list_ids()
Get all task list ids.
public
static get_list_ids() : array<string|int, mixed>
Return values
array<string|int, mixed> —get_lists()
Get all task lists.
public
static get_lists() : array<string|int, mixed>
Return values
array<string|int, mixed> —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 —get_visible()
Get visible task lists.
public
static get_visible() : mixed
Return values
mixed —init()
Initialize the task lists.
public
static init() : mixed
Return values
mixed —init_default_lists()
Initialize default lists.
public
static init_default_lists() : mixed
Return values
mixed —init_tasks()
Initialize tasks.
public
static init_tasks() : mixed
Return values
mixed —instance()
Get class instance.
public
final static instance() : mixed
Return values
mixed —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 —menu_task_count()
Add badge to homescreen menu item for remaining tasks
public
static menu_task_count() : mixed
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 —setup_tasks_remaining()
Return number of setup tasks remaining
public
static setup_tasks_remaining() : number
Return values
number —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.