File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ' ],
You can’t perform that action at this time.
0 commit comments