• Hi Guys

    I want to allow admins and editors to view my plugin. The problem is the add_menu_page only allows me to specify one group only. How can I overcome this ?

    add_menu_page(
    	'Plugin',
    	'Plugin',
    	'editor',
    	'manageplugin',
    	array($this,'print_page')
    );
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter shadd

    (@shadd)

    bump

    My understanding is that its capabilities not roles.

    Replace the user role with the lowest capability that would apply to all of the roles you want to see the menu item as per

    http://codex.wordpress.org/Roles_and_Capabilities

    For example, replace editor with ‘moderate_comments’

    add_menu_page('Plugin', 'Plugin', 'moderate_comments', 'manageplugin',
    	array($this,'print_page')
    );

    or for author you could use

    add_menu_page('Plugin', 'Plugin', 'read', 'manageplugin',
    	array($this,'print_page')
    );
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘add_menu_page: multiple usergroups ?’ is closed to new replies.