/** * Adds Jigoshop menus. */ public function beforeMenu() { $menu = $this->wp->getMenu(); if ($this->wp->currentUserCan('manage_jigoshop')) { $menu[54] = array('', 'read', 'separator-jigoshop', '', 'wp-menu-separator jigoshop'); } $this->wp->addMenuPage(__('Jigoshop'), __('Jigoshop'), 'manage_jigoshop', 'jigoshop', array($this->dashboard, 'display'), null, 55); foreach ($this->pages['jigoshop'] as $page) { /** @var $page PageInterface */ $this->wp->addSubmenuPage(self::MENU, $page->getTitle(), $page->getTitle(), $page->getCapability(), $page->getMenuSlug(), array($page, 'display')); } foreach ($this->pages['products'] as $page) { /** @var $page PageInterface */ $this->wp->addSubmenuPage('edit.php?post_type=' . Types::PRODUCT, $page->getTitle(), $page->getTitle(), $page->getCapability(), $page->getMenuSlug(), array($page, 'display')); } foreach ($this->pages['orders'] as $page) { /** @var $page PageInterface */ $this->wp->addSubmenuPage('edit.php?post_type=' . Types::ORDER, $page->getTitle(), $page->getTitle(), $page->getCapability(), $page->getMenuSlug(), array($page, 'display')); } $this->wp->doAction('jigoshop\\admin\\before_menu'); }