TaskList
in package
Uses
TaskTraits
Task List class.
Table of Contents
- COMPLETED_OPTION = 'woocommerce_task_list_completed_lists'
- Option name of completed task lists.
- HIDDEN_OPTION = 'woocommerce_task_list_hidden_lists'
- Option name hidden task lists.
- REMINDER_BAR_HIDDEN_OPTION = 'woocommerce_task_list_reminder_bar_hidden'
- Option name of hidden reminder bar.
- $display_progress_header : bool
- ID.
- $event_prefix : string|null
- Event prefix.
- $hidden_id : string
- ID.
- $id : string
- ID.
- $options : array<string|int, mixed>
- Array of custom options.
- $sort_by : array<string|int, mixed>
- Sort keys.
- $task_class_id_map : array<string|int, mixed>
- Key value map of task class and id used for sections.
- $tasks : array<string|int, mixed>
- Tasks.
- $title : string
- Title.
- $visible : bool
- Task list visibility.
- $sections : array<string|int, mixed>
- Array of TaskListSection.
- __construct() : mixed
- Constructor
- add_task() : mixed
- Add task to the task list.
- get_json() : array<string|int, mixed>
- Get the list for use in JSON.
- get_keep_completed_task_list() : string
- Returns option to keep completed task list.
- get_list_id() : string
- Get the task list ID.
- get_sections() : array<string|int, mixed>
- Get task list sections.
- get_task() : Task
- Get only visible tasks in list.
- get_viewable_tasks() : array<string|int, mixed>
- Get only visible tasks in list.
- has_previously_completed() : bool
- Check if a task list has previously been marked as complete.
- hide() : bool
- Hide the task list.
- is_complete() : bool
- Check if all viewable tasks are complete.
- is_hidden() : bool
- Check if the task list is hidden.
- is_visible() : bool
- Check if the task list is visible.
- maybe_set_default_layout() : mixed
- Sets the default homepage layout to two_columns if "setup" tasklist is completed or hidden.
- possibly_remove_reminder_bar() : mixed
- Remove reminder bar four weeks after store creation.
- possibly_track_completion() : mixed
- Track list completion of viewable tasks.
- prefix_event() : string
- Prefix event for track event naming.
- record_tracks_event() : string
- Record a tracks event with the prefixed event name.
- sort_tasks() : TaskList
- Sorts the attached tasks array.
- unhide() : bool
- Undo hiding of the task list.
Constants
COMPLETED_OPTION
Option name of completed task lists.
public
mixed
COMPLETED_OPTION
= 'woocommerce_task_list_completed_lists'
HIDDEN_OPTION
Option name hidden task lists.
public
mixed
HIDDEN_OPTION
= 'woocommerce_task_list_hidden_lists'
REMINDER_BAR_HIDDEN_OPTION
Option name of hidden reminder bar.
public
mixed
REMINDER_BAR_HIDDEN_OPTION
= 'woocommerce_task_list_reminder_bar_hidden'
Properties
$display_progress_header
ID.
public
bool
$display_progress_header
= false
$event_prefix
Event prefix.
public
string|null
$event_prefix
= null
$hidden_id
ID.
public
string
$hidden_id
= ''
$id
ID.
public
string
$id
= ''
$options
Array of custom options.
public
array<string|int, mixed>
$options
= array()
$sort_by
Sort keys.
public
array<string|int, mixed>
$sort_by
= array()
$task_class_id_map
Key value map of task class and id used for sections.
public
array<string|int, mixed>
$task_class_id_map
= array()
Tags
$tasks
Tasks.
public
array<string|int, mixed>
$tasks
= array()
$title
Title.
public
string
$title
= ''
$visible
Task list visibility.
public
bool
$visible
= true
$sections
Array of TaskListSection.
private
array<string|int, mixed>
$sections
= array()
Tags
Methods
__construct()
Constructor
public
__construct([array<string|int, mixed> $data = array() ]) : mixed
Parameters
- $data : array<string|int, mixed> = array()
-
Task list data.
Return values
mixed —add_task()
Add task to the task list.
public
add_task(Task $task) : mixed
Parameters
- $task : Task
-
Task class.
Return values
mixed —get_json()
Get the list for use in JSON.
public
get_json() : array<string|int, mixed>
Return values
array<string|int, mixed> —get_keep_completed_task_list()
Returns option to keep completed task list.
public
get_keep_completed_task_list() : string
Return values
string —get_list_id()
Get the task list ID.
public
get_list_id() : string
Return values
string —get_sections()
Get task list sections.
public
get_sections() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —get_task()
Get only visible tasks in list.
public
get_task(string $task_id) : Task
Parameters
- $task_id : string
-
id of task.
Return values
Task —get_viewable_tasks()
Get only visible tasks in list.
public
get_viewable_tasks() : array<string|int, mixed>
Return values
array<string|int, mixed> —has_previously_completed()
Check if a task list has previously been marked as complete.
public
has_previously_completed() : bool
Return values
bool —hide()
Hide the task list.
public
hide() : bool
Return values
bool —is_complete()
Check if all viewable tasks are complete.
public
is_complete() : bool
Return values
bool —is_hidden()
Check if the task list is hidden.
public
is_hidden() : bool
Return values
bool —is_visible()
Check if the task list is visible.
public
is_visible() : bool
Return values
bool —maybe_set_default_layout()
Sets the default homepage layout to two_columns if "setup" tasklist is completed or hidden.
public
maybe_set_default_layout(array<string|int, mixed> $completed_or_hidden_tasklist_ids) : mixed
Parameters
- $completed_or_hidden_tasklist_ids : array<string|int, mixed>
-
Array of tasklist ids.
Return values
mixed —possibly_remove_reminder_bar()
Remove reminder bar four weeks after store creation.
public
static possibly_remove_reminder_bar() : mixed
Return values
mixed —possibly_track_completion()
Track list completion of viewable tasks.
public
possibly_track_completion() : mixed
Return values
mixed —prefix_event()
Prefix event for track event naming.
public
prefix_event(string $event_name) : string
Parameters
- $event_name : string
-
Event name.
Return values
string —record_tracks_event()
Record a tracks event with the prefixed event name.
public
record_tracks_event(string $event_name[, array<string|int, mixed> $args = array() ]) : string
Parameters
- $event_name : string
-
Event name.
- $args : array<string|int, mixed> = array()
-
Array of tracks arguments.
Return values
string — Prefixed event name.sort_tasks()
Sorts the attached tasks array.
public
sort_tasks([array<string|int, mixed> $sort_by = array() ]) : TaskList
Parameters
- $sort_by : array<string|int, mixed> = array()
-
list of columns with sort order.
Return values
TaskList — returns $this, for chaining.unhide()
Undo hiding of the task list.
public
unhide() : bool