Yoast\WP\SEO\Task_List\User_Interface\Tasks
Get_Tasks_Route::get_tasks
Gets tasks with their information.
Метод класса: Get_Tasks_Route{}
Хуков нет.
Возвращает
WP_REST_Response. The success or failure response.
Использование
$Get_Tasks_Route = new Get_Tasks_Route(); $Get_Tasks_Route->get_tasks(): WP_REST_Response;
Код Get_Tasks_Route::get_tasks() Get Tasks Route::get tasks Yoast 27.7
public function get_tasks(): WP_REST_Response {
try {
$this->action_tracker->track_version_for_performed_action( 'task_list_first_opened_on' );
$tasks_data = $this->tasks_repository->get_tasks_data();
} catch ( Exception $exception ) {
return new WP_REST_Response(
[
'success' => false,
'error' => $exception->getMessage(),
],
$exception->getCode(),
);
}
return new WP_REST_Response(
[
'success' => true,
'tasks' => $tasks_data,
],
200,
);
}