WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Promote Menu Editing to Top-Level? (5 posts)

  1. tirussell
    Member
    Posted 4 years ago #

    Is there a way to "promote" the new menu interface to the top-level admin links? I would like my authors to be able to manage menus within their sites (I am using WordPress more as a CMS in this case), but not other appearance items like themes, header, etc.

    I think I can do this with add_menu_page, but how do I connect this to the existing functionality?

  2. tirussell
    Member
    Posted 4 years ago #

    bump

  3. tirussell
    Member
    Posted 4 years ago #

    last friendly bump - any help much appreciated!

  4. tirussell
    Member
    Posted 4 years ago #

    Figured it out:

    function add_nav_menu() {
    	if (!current_user_can('update_core')) {
    		$page_title = "Manage Your Navigation Menu";
    		$menu_title = "Menu";
    		$capability = "edit_posts";
    		$menu_slug = "nav-menus.php";
    		$icon_url = plugins_url('menu.png');
    
    		add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position );
    	}
    }
    // Add capability to the editor role
    
    	// store the 'Editor' role
    	$edit_editor = get_role('editor');
    
    	// add a capability of 'upload_files';
    	$edit_editor->add_cap('edit_themes');
    	$edit_editor->add_cap('edit_theme_options');
  5. tirussell
    Member
    Posted 4 years ago #

    To be clear, the above should go in your theme's functions.php file or be part of a plugin.

Topic Closed

This topic has been closed to new replies.

About this Topic