From e4e61367dc6fc51b7de8caff3cb461769980d444 Mon Sep 17 00:00:00 2001 From: Chrissi2812 Date: Mon, 15 Oct 2018 14:42:59 +0200 Subject: [PATCH] filter hidden menu items --- src/platforms/joomla/classes/Gantry/Framework/Menu.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/platforms/joomla/classes/Gantry/Framework/Menu.php b/src/platforms/joomla/classes/Gantry/Framework/Menu.php index d8283482f..c28247476 100644 --- a/src/platforms/joomla/classes/Gantry/Framework/Menu.php +++ b/src/platforms/joomla/classes/Gantry/Framework/Menu.php @@ -264,6 +264,11 @@ public function getList(array $params, array $items) $menuItems = $this->getItemsFromPlatform($params); + // Filter hidden items + $menuItems = array_filter($menuItems, function($item) { + return $item->params->get('menu_show', null) !== 0; + }); + $itemMap = []; foreach ($items as $path => &$itemRef) { if (isset($itemRef['id']) && is_numeric($itemRef['id'])) {