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,23 +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_items ();
161- $ pending_todo_items = [];
162- foreach ( $ todo_items as $ item ) {
163- if ( ! isset ( $ item ['status ' ] ) || 'completed ' !== $ item ['status ' ] ) {
164- $ pending_todo_items [] = $ item ['title ' ];
165- }
166- }
167- $ data ['todo ' ] = $ pending_todo_items ;
168-
169160 // Pending tasks include remote tasks.
170161 $ ravis_recommendations = \progress_planner ()->get_suggested_tasks ()->get_pending_tasks_with_details ();
171162 $ data ['recommendations ' ] = [];
172163 foreach ( $ ravis_recommendations as $ recommendation ) {
173164 $ data ['recommendations ' ][] = [
174- 'id ' => $ recommendation ['task_id ' ],
175- 'title ' => $ recommendation ['title ' ],
176- '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 ' ],
177169 ];
178170 }
179171
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ public function testEndpoint() {
144144 'scores ' ,
145145 'website ' ,
146146 'timezone_offset ' ,
147- 'todo ' ,
147+ 'recommendations ' ,
148148 'plugin_url ' ,
149149 ];
150150
You can’t perform that action at this time.
0 commit comments