WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to be able to grant my editors the power to change the menu, can this be done?

The appearance tab doesn't appear to be an option at all, can I make it so?

share|improve this question
up vote 28 down vote accepted

add this to your theme's functions.php:

// add editor the privilege to edit theme

// get the the role object
$role_object = get_role( 'editor' );

// add $cap capability to this role object
$role_object->add_cap( 'edit_theme_options' );
share|improve this answer
is get_role a class? – Mild Fuzz Feb 24 '11 at 13:31
@Mild Fuzz - not itself no, but it returns an instance of WP_Role – TheDeadMedic Aug 14 '11 at 12:25

If you want your users to be able to change the navigation menu, but not the other options under appearance: use this

// Do this only once. Can go anywhere inside your functions.php file
$role_object = get_role( 'editor' );
$role_object->add_cap( 'edit_theme_options' );

You can comment out this entire code after you have refreshed your admin panel, because the above code will make persistent changes to the database.

You now have all the options under appearance visible to the editors. You can hide the other options like so:

function hide_menu() {

    remove_submenu_page( 'themes.php', 'themes.php' ); // hide the theme selection submenu
    remove_submenu_page( 'themes.php', 'widgets.php' ); // hide the widgets submenu

    // these are theme-specific. Can have other names or simply not exist in your current theme.
    remove_submenu_page( 'themes.php', 'yiw_panel' );
    remove_submenu_page( 'themes.php', 'custom-header' );
    remove_submenu_page( 'themes.php', 'custom-background' );

add_action('admin_head', 'hide_menu');

The last 3 lines in the hide_menu() function are theme specific for my theme. You can find the second parameter by clicking on the submenu you want to hide, in the admin panel. Your URL will then be something like: example.com/wp-admin/themes.php?page=yiw_panel

So, in this example, the second parameter for the remove_submenu_page() function will be yiw_panel

share|improve this answer

In WordPress 3.8, this would be better code than the current accepted answer.

 * @var $roleObject WP_Role
$roleObject = get_role( 'editor' );
if (!$roleObject->has_cap( 'edit_theme_options' ) ) {
    $roleObject->add_cap( 'edit_theme_options' );
share|improve this answer

When I look at the admin menu structure, it seems the nav-menus.php link is tied to the capability edit_theme_options. Can you modify the editor role to include this capability? This would also give them the option to edit widgets, I don't know whether this is a problem? All the menu Ajax stuff is restricted by this capability, so just changing the admin menu capability for editing menus will probably not work.

share|improve this answer

instal plugin "User Role Editor" - Switch edit_theme_options ON - install plugin Adminimize - switch off "Widgets" and "Switch Theme" for Editors ;)

share|improve this answer

I´ve found, that your menu will work this way: instal plugin "User Role Editor" and there you can edit condition for editor role and other too. Switch edit_theme_options ON. But now: you will see "menu" -option under "themes", "widgets". For me: After click to "menu" (as editor) I´d not see filled options but empty. So I´d deactivate plugin "User Role Editor" and filled options for "menu" appears correctly. Note that deactivating plugin "User Role Editor" remains conditions for editor active! Good for me, maybe it will help you too

share|improve this answer

protected by toscho Dec 8 '14 at 5:40

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.