Want to give editor access to sidebar in WordPress? The edit_theme_options capability should allow the user to edit the sidebar as described on this page : http://codex.wordpress.org/Appearance_Widgets_SubPanel. Add to following code in your functions.php file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | function custom_admin_menu() { $user = new WP_User(get_current_user_id()); if (!empty( $user->roles) && is_array($user->roles)) { foreach ($user->roles as $role) $role = $role; } if($role == "editor") { remove_submenu_page( 'themes.php', 'themes.php' ); remove_submenu_page( 'themes.php', 'nav-menus.php' ); } } add_action('admin_menu', 'custom_admin_menu'); |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.