Editor role to edit Menus - add_cap() works, but does not add menu item (1 post)

  1. dabnpits
    Posted 4 years ago #

    I've used the following to add the "edit_theme_options" capability to the Editor role:

    $role_object = get_role( 'editor' );
    $role_object->add_cap( 'edit_theme_options' );

    This works fine, but I am unable to see the "Menus" item under Appearance. I can navigate directly to the page when logged in as an Editor (/wp-admin/nav-menus.php) and it works fine. I tried adding the "Menus" item back under Appearance manually using:

    add_submenu_page('themes.php', 'Menus', 'Menus', 'edit_theme_options', 'nav-menus.php');

    This also works, but once doing so, the missing menu items under Appearance suddenly appear, so now there are two "Menus" items.

    Any ideas what I may be doing wrong? This used to work in previous version of WordPress.

Topic Closed

This topic has been closed to new replies.

About this Topic