Hello,
If you just want to hide them an easy way would be through CSS.
You can add a function like this:
function add_user_role_body_class( $userClass ) {
global $current_user;
foreach( $current_user->roles as $userRole )
$userClass .= ' user-role-' . $userRole;
return trim( $userClass);
}
add_filter( 'admin_body_class', 'add_user_role_body_class' );
This will add the ex ‘user-role-administrator’ class to your admin body tag.
Then you can add the appropriate CSS to hide anything you like example:
body.user-role-administrator #myDiv {
visibility:hidden !important;
position:absolute !important;
}
About the CSS:
With display: none, the form fields won’t be submitted, so instead you can use visibility:hidden .
You could also go a bit more advanced by totally removing them with jQuery etc but that depends on what those metaboxes are used for etc if they are validated etc etc.
Best regards,
Konstantinos