From 9a3ead316763d7418fca62c223ec1cc1cb177ae5 Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Fri, 12 Jul 2019 14:42:59 -0400 Subject: [PATCH] Add array keys for the summary data, for each plugin --- setup/routes/dashboard.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/setup/routes/dashboard.php b/setup/routes/dashboard.php index dd36638..439d8db 100644 --- a/setup/routes/dashboard.php +++ b/setup/routes/dashboard.php @@ -88,21 +88,28 @@ class GLMA_Dashboard_Rest_Controller // Call to undefined function get_members_summar() //$members = $this->wpdb->get_results( $sql ); - $summary[] = GLM_MEMBERS_PLUGIN_DB_PREFIX; - if ( defined("GLM_MEMBERS_EVENTS_PLUGIN_PATH") ) { + + //$summary[] = $this->config['addOns']; + //$addons = array("members", "events"); + //foreach ($this->config->addOns as $addon) { + //$summary[] = $addon; + //} + + + if ( defined("GLM_MEMBERS_PLUGIN_PATH") ) { $members = $this->get_members_summary(); - $summary[] = $members; + $summary['members'] = array("members" => $members); } if ( defined("GLM_MEMBERS_EVENTS_PLUGIN_PATH") ) { $events = $this->get_events_summary(); - $summary[] = $events; + $summary['events'] = array("events" => $events); } if ( defined("GLM_MEMBERS_COUPONS_PLUGIN_PATH") ) { - $summary[] = $this->get_coupons_summary(); + $summary['coupons'] = array("coupons", $this->get_coupons_summary() ); } if ( defined("GLM_MEMBERS_PACKAGING_PLUGIN_PATH") ) { - $summary[] = $this->get_packages_summary(); + $summary['packaging'] = array("packaging", $this->get_packages_summary() ); } return rest_ensure_response( array_values( $summary ) ); -- 2.17.1