From 1ce54c599176d6274d97dcc0e45a3e87e7030a86 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Fri, 12 Jul 2019 15:41:01 -0400 Subject: [PATCH] reshaping the summary data to be one monolithic object containing arrays for each addon --- setup/routes/dashboard.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/setup/routes/dashboard.php b/setup/routes/dashboard.php index 7f82640..cb40a4b 100644 --- a/setup/routes/dashboard.php +++ b/setup/routes/dashboard.php @@ -97,22 +97,23 @@ class GLMA_Dashboard_Rest_Controller //} - if ( isset($this->config['addOns']['glm-member-db']) ) { + + if ( defined("GLM_MEMBERS_PLUGIN_PATH") ) { $members = $this->get_members_summary(); - $summary[] = array("members" => $members); + $summary['members'] = $members; } if ( defined("GLM_MEMBERS_EVENTS_PLUGIN_PATH") ) { $events = $this->get_events_summary(); - $summary[] = array("events" => $events); + $summary['events'] = $events; } if ( defined("GLM_MEMBERS_COUPONS_PLUGIN_PATH") ) { - $summary[] = array("coupons", $this->get_coupons_summary() ); + $summary['coupons'] = $this->get_coupons_summary(); } if ( defined("GLM_MEMBERS_PACKAGING_PLUGIN_PATH") ) { - $summary[] = array("packaging", $this->get_packages_summary() ); + $summary['packaging'] = $this->get_packages_summary(); } - return rest_ensure_response( get_object_vars( (object) array_values( $summary ) ) ); + return rest_ensure_response( get_object_vars ( (object) $summary ) ); }, ) ) -- 2.17.1