Reputation: 25
I have a wordpress website with learnpress plugin installed. We have tried all the available user role management plugins to remove admin menu items for a specific role and have managed to remove most of the ones we wanted with plugin "adminimize". However, this plugin does was not able to remove two unwanted admin menu items pointed out in this image https://i.sstatic.net/WermS.jpg We also tried some functions.php codes to remove menu items but are still not able to find solution. Can someone propose a solution? Thank you.
Upvotes: 0
Views: 1114
Reputation:
Have you tried something like this in functions.php in your theme ?
add_action( 'admin_init', 'my_remove_menu_pages' );function my_remove_menu_pages() {
global $user_ID;
if ( current_user_can( 'author' ) ) {
remove_menu_page( 'edit.php' );
remove_menu_page( 'path visible when you hover on the menu' );
remove_menu_page( 'edit.php?post_type=news' ); /*for custom post type*/
}}
Upvotes: 0