From 5632ef2fb9dca11cc85bb5d9e8ae8233afa920f6 Mon Sep 17 00:00:00 2001 From: gocsp Date: Wed, 25 May 2016 09:05:26 +0200 Subject: [PATCH] Add capabilities as argument for panels --- Herbert/Framework/Panel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Herbert/Framework/Panel.php b/Herbert/Framework/Panel.php index d7102df..c23d43b 100644 --- a/Herbert/Framework/Panel.php +++ b/Herbert/Framework/Panel.php @@ -206,7 +206,7 @@ protected function addPanel($panel) add_menu_page( $panel['title'], $panel['title'], - 'manage_options', + isset($panel['capability']) && $panel['capability'] ? $panel['capability'] : 'manage_options', $panel['slug'], $this->makeCallable($panel), isset($panel['icon']) ? $this->fetchIcon($panel['icon']) : '', @@ -246,7 +246,7 @@ protected function addSubPanel($panel) $panel['parent'], $panel['title'], $panel['title'], - 'manage_options', + isset($panel['capability']) && $panel['capability'] ? $panel['capability'] : 'manage_options', $panel['slug'], isset($panel['rename']) && $panel['rename'] ? null : $this->makeCallable($panel) );