Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to create a custom WordPress-dashboard for one of my cliënts. Now I want to hide the "appearance"-menu in the dashboard, but I want the submenu "Menus" to be visible as a mainmenu-item.

The "appearance"-menu is normally automaticly hidden since the client's profile has an editor-role. So I bring the "appearance" menu back for editors like this:

// get the the role object
$role_object = get_role( 'editor' );
// add $cap capability to this role object
$role_object->add_cap( 'edit_theme_options' );

I can hide the other submenu-items with CSS, but then I still got the "appearance"-menu and I don't want the cliënt to change the theme.

Is there any solution to make the submenu "Menus" visible as a mainmenu-item?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

At first you have to remove the submenu and then add it again. The code should look something like this:

add_action( 'admin_menu', 'register_my_custom_menu_page' );

function register_my_custom_menu_page( ) {
    remove_submenu_page( 'themes.php','nav-menus.php') ; 
    add_menu_page( 'Menus', 'menu', 'manage_options', 'nav-menus.php' );
}

See the WordPress Codex

share|improve this answer
    
That makes sense, awesome! Worked fine over here, thanks. –  Stijn Van den Bogaert Jan 11 at 23:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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