getherbert / herbert

The WordPress Plugin Framework:
http://getherbert.com/
632 stars 94 forks source link

Add permission(capability) to panel #107

Closed giwrgos88 closed 8 years ago

giwrgos88 commented 8 years ago

If the wordpress is using any permission plugin how I can add permissions to the panel as well?

I saw the function addPanel inside the Herbert\Framework\Panel

    protected function addPanel($panel)
    {
        add_menu_page(
            $panel['title'],
            $panel['title'],
            'manage_options',
            $panel['slug'],
            $this->makeCallable($panel),
            isset($panel['icon']) ? $this->fetchIcon($panel['icon']) : '',
            isset($panel['order']) ? $panel['order'] : null
        );

        if (isset($panel['rename']) && !empty($panel['rename']))
        {
            $this->addSubPanel([
                'title'  => $panel['rename'],
                'rename' => true,
                'slug'   => $panel['slug'],
                'parent' => $panel['slug']
            ]);
        }
    }

and there is not any option of permission

jeremyzahner commented 8 years ago

@giwrgos88 This should now be working after https://github.com/getherbert/framework/pull/24 was merged.

It is not yet in the docs tough.

giwrgos88 commented 8 years ago

cool thanks @jeremyzahner