Skip to content

Commit 8689fdb

Browse files
committed
rest api change for new email format
1 parent c0cbc28 commit 8689fdb

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

classes/class-rest-api-stats.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,19 +157,23 @@ 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_items();
160+
$todo_items = \progress_planner()->get_todo()->get_pending_items();
161161
$pending_todo_items = [];
162162
foreach ( $todo_items as $item ) {
163-
if ( ! isset( $item['status'] ) || 'completed' !== $item['status'] ) {
164-
$pending_todo_items[] = $item['title'];
165-
}
163+
$pending_todo_items[] = $item['title'];
166164
}
167165
$data['todo'] = $pending_todo_items;
168166

169167
// Pending tasks include remote tasks.
170168
$ravis_recommendations = \progress_planner()->get_suggested_tasks()->get_pending_tasks_with_details();
171169
$data['recommendations'] = [];
172170
foreach ( $ravis_recommendations as $recommendation ) {
171+
172+
// Skip user (todo) tasks.
173+
if ( 'user' === $recommendation['provider_id'] ) {
174+
continue;
175+
}
176+
173177
$data['recommendations'][] = [
174178
'id' => $recommendation['task_id'],
175179
'title' => $recommendation['title'],

0 commit comments

Comments
 (0)