WooCommerce Code Reference

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

Properties

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

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

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
stringPrefixed 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
TaskListreturns $this, for chaining.