This is my code and I dont know why isnt working
JavaScript
x
add_action('admin_menu', 'hide_a_menu');
function hide_a_menu() {
global $current_user;
$user_id = get_current_user_id();
if($user_id == '41') {
remove_menu_page( 'edit-comment.php' );
}
}
Advertisement
Answer
You misspelled the name edit-comment.php
try the below code.
JavaScript
add_action('admin_menu', 'hide_a_menu');
function hide_a_menu() {
global $current_user;
$user_id = get_current_user_id();
if($user_id == '41') {
remove_menu_page( 'edit-comments.php' );
}
}