hide page menu from admin panel for specific users
Question
I want to hide page menu from the admin panel for a specific user type. I tried it with the below codes in
functions.php
function hide_menu_items() {
global $menu;
global $current_user;
get_currentuserinfo();
if( $current_user->user_login == 'username' ):
remove_menu_page( 'admin.php?page=megamenu' );
remove_menu_page( 'admin.php?page=mycustompage' );
endif;
}
add_action( 'admin_menu', 'hide_menu_items' );
It’s not working but it only hides post_types
0
admin-menu, sub-menu, user-roles, users
4 years
2020-02-09T08:38:22-05:00
2020-02-09T08:38:22-05:00 0 Answers
65 views
0
Leave an answer