Support » Plugins and Hacks » Promote Menu Editing to Top-Level?

  • Resolved tirussell

    (@tirussell)


    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?

Viewing 4 replies - 1 through 4 (of 4 total)
  • bump

    last friendly bump – any help much appreciated!

    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');

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Promote Menu Editing to Top-Level?’ is closed to new replies.