Forums

[resolved] Adding a new capability to editor role (2 posts)

  1. pcather
    Member
    Posted 8 months ago #

    I'm using User Role Editor to edit the capabilities of my Editor. Works great except for one plugin. This code is in the plugin: http://pastebin.com/wdgRYM5C

    I added code in lines 13-17. This plug-in shows on The Appearance menu when I'm logged in as an administrator. But when I log in as my editor the appearance menu is gone and the plugin is not showing. I've tried moving to different areas of the menu with the same result.

    The ot-cycle capability shows in the User Role Editor and is clicked on.

    Any advice would be appreciated.

  2. Vladimir Garagulya
    Member
    Posted 7 months ago #

    Look at line 125 of wp-admin/menu.php

    if ( current_user_can( 'switch_themes') ) {
    	$menu[60] = array( __('Appearance'), 'switch_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div' );
    		$submenu['themes.php'][5]  = array(__('Themes'), 'switch_themes', 'themes.php');
    		if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) )
    			$submenu['themes.php'][10] = array(__('Menus'), 'edit_theme_options', 'nav-menus.php');
    } else {
    	$menu[60] = array( __('Appearance'), 'edit_theme_options', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div' );
    		$submenu['themes.php'][5]  = array(__('Themes'), 'edit_theme_options', 'themes.php');
    		if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) )
    			$submenu['themes.php'][10] = array(__('Menus'), 'edit_theme_options', 'nav-menus.php' );
    }

    According to it your editor role should have 'switch_themes' or at least 'edit_theme_options' capabilities turned on to see the 'Appearance' menu.

Reply

You must log in to post.

About this Topic