Skip to content

Commit 3058469

Browse files
committed
merge RR & user tasks
1 parent 1f3de8e commit 3058469

1 file changed

Lines changed: 4 additions & 16 deletions

File tree

classes/class-rest-api-stats.php

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -157,27 +157,15 @@ public function get_stats( \WP_REST_Request $request ) {
157157
// Timezone offset.
158158
$data['timezone_offset'] = \wp_timezone()->getOffset( new \DateTime( 'midnight' ) ) / 3600;
159159

160-
$todo_items = \progress_planner()->get_todo()->get_pending_items();
161-
$pending_todo_items = [];
162-
foreach ( $todo_items as $item ) {
163-
$pending_todo_items[] = $item['title'];
164-
}
165-
$data['todo'] = $pending_todo_items;
166-
167160
// Pending tasks include remote tasks.
168161
$ravis_recommendations = \progress_planner()->get_suggested_tasks()->get_pending_tasks_with_details();
169162
$data['recommendations'] = [];
170163
foreach ( $ravis_recommendations as $recommendation ) {
171-
172-
// Skip user tasks.
173-
if ( 'user' === $recommendation['provider_id'] ) {
174-
continue;
175-
}
176-
177164
$data['recommendations'][] = [
178-
'id' => $recommendation['task_id'],
179-
'title' => $recommendation['title'],
180-
'url' => isset( $recommendation['url'] ) ? $recommendation['url'] : '',
165+
'id' => $recommendation['task_id'],
166+
'title' => $recommendation['title'],
167+
'url' => isset( $recommendation['url'] ) ? $recommendation['url'] : '',
168+
'provider_id' => $recommendation['provider_id'],
181169
];
182170
}
183171

0 commit comments

Comments
 (0)