Plugin Contributor
Qurl
(@qurl)
Please correct me if I’m wrong, but I don’t think an editor has “edit_theme_options” capabilities, so the menu item won’t be at least accessible.
Please correct me if I’m wrong, but I don’t think an editor has “edit_theme_options” capabilities, so the menu item won’t be at least accessible.
That is correct. Let me clarify.
What I did was add
$role = get_role('editor');
$role->add_cap('edit_theme_options');
to allow the editor role to see the Appearance menu (because I wanted them to be able to access Widgets, and Menus).
I then added
function we_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' );
}
}
add_action('admin_menu', 'we_custom_admin_menu');
To remove the Themes submenu item.
But the Dynamic Widgets submenu item is still there in the Appearance menu, because it is called with themes.php
But I don’t want the Editor role to see the Dynamic Widgets submenu.
So… how do I remove it?
Thanks!
Plugin Contributor
Qurl
(@qurl)
Try
remove_submenu_page( 'themes.php', 'dynwid-config' );
Please be aware there is also a DW link within the Widgets Admin.
Yeah, I already tried that. Didn’t work. Sorry…
Plugin Contributor
Qurl
(@qurl)
Did you also try
remove_submenu_page( ‘themes.php’, ‘themes.php?page=dynwid-config’);
Just tried
remove_submenu_page( 'themes.php', 'themes.php?page=dynwid-config');
That didn’t work either.
I found another way to hide it as a work around.
So I can get by…
Thanks
HI WebEndev —
Do you mind sharing your solution to hiding the dynamic widgets from the appearance menu? I’d love to do the same thing.
Thanks!
Hi Feshin,
I looked around, but couldn’t find my coded solution.
This however http://wordpress.org/extend/plugins/admin-menu-editor/ works very well and will to it for you.
Thanks, WebEndev! I’ll take a look at that plugin. Really appreciate you taking the time to respond!
Plugin Contributor
Qurl
(@qurl)
Thanks for sharing WebEndev!