/** * Get array of active shop plugins * * @return array plugin slug => plugin name */ public function get_shop_plugins() { $active_shop_plugins = WpMenuCart::get_active_shops(); //switch keys & values, then strip plugin path to folder foreach ($active_shop_plugins as $key => $value) { $filtered_active_shop_plugins[dirname($value)] = $key; } $active_shop_plugins = isset($filtered_active_shop_plugins) ? $filtered_active_shop_plugins : ''; return $active_shop_plugins; }