Forums

Menu for authors (2 posts)

  1. raulsan
    Member
    Posted 3 years ago #

    Hello,
    I am developing a plugin with a new menu. I did it and it works, the problem is that it is only visible for administrators. How can I make it visible for Authors?

    my code for the now is:

    <?php
    
    define('__DIR__',pathinfo(__FILE__,PATHINFO_DIRNAME));
    
    add_action('admin_menu','menu_panels');
    
    function menu_panels(){
    add_menu_page(__('Panels'), __('Panels'), 3, __DIR__ . '/pag-panels.php');
    }
    ?>

    THANK YOU!!

  2. raulsan
    Member
    Posted 3 years ago #

    OK, I solved it myself, the only problem is that I needed a lower user_level. It works with 2:

    <?php
    
    define('__DIR__',pathinfo(__FILE__,PATHINFO_DIRNAME));
    
    add_action('admin_menu','menu_panels');
    
    function menu_panels(){
    add_menu_page(__('Panels'), __('Panels'), 2, __DIR__ . '/pag-panels.php');
    }
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic