Automattic\WooCommerce\Admin\Features\OnboardingTasks
TaskList::hide()
Hide the task list.
Метод класса: TaskList{}
Хуков нет.
Возвращает
true|false
.
Использование
$TaskList = new TaskList(); $TaskList->hide();
Код TaskList::hide() TaskList::hide WC 9.2.3
public function hide() { if ( $this->is_hidden() ) { return; } $viewable_tasks = $this->get_viewable_tasks(); $completed_count = array_reduce( $viewable_tasks, function( $total, $task ) { return $task->is_complete() ? $total + 1 : $total; }, 0 ); $this->record_tracks_event( 'completed', array( 'action' => 'remove_card', 'completed_task_count' => $completed_count, 'incomplete_task_count' => count( $viewable_tasks ) - $completed_count, 'tasklist_id' => $this->id, ) ); $hidden = get_option( self::HIDDEN_OPTION, array() ); $hidden[] = $this->hidden_id ? $this->hidden_id : $this->id; $this->maybe_set_default_layout( $hidden ); return update_option( self::HIDDEN_OPTION, array_unique( $hidden ) ); }