کد زیر
منبع :
https://stackoverflow.com/questions/56188697/how-to-hide-posts-and-pages-in-the-wordpress-admin-panel-from-other-admin
function remove_menus()
{
global $current_user;
get_currentuserinfo();
if($current_user->user_login != ‘wpadmin’)
{
remove_menu_page( ‘edit.php’ ); //Posts
remove_menu_page( ‘edit.php?post_type=page’ ); //Pages
}
}
add_action( ‘admin_menu’, ‘remove_menus’ );
این کد را باید در انتهای فانکشن قالب قرار داد