Support » Plugins » add_menu_page access to editors

  • I have written a plugin which uses add_menu_page and add_submenu_page with the capability ‘manage_options’.

    This works for the admin dashboard fine.

    How can I get it to work for an editor dashboard ? preferably without giving editors any other capabilities.

Viewing 1 replies (of 1 total)
  • The answer to allowing editors to see custom menus is to change the capabilities in the add_menu_page function.

    Get an editor capability.

    Look up the proper code

    Looking at the example text from add_menu_page, where it says ‘manage_options’, change it to ‘edit_others_posts’ or another editor capability.

     * Register a custom menu page.
    function wpdocs_register_my_custom_menu_page() {
            __( 'Custom Menu Title', 'textdomain' ),
            'custom menu',
            plugins_url( 'myplugin/images/icon.png' ),
    add_action( 'admin_menu', 'wpdocs_register_my_custom_menu_page' );
Viewing 1 replies (of 1 total)
  • The topic ‘add_menu_page access to editors’ is closed to new replies.