I want to hide some default fields of the backend user profile page based on the role of the user whose profile is being viewed (by the admin in this case).
I used the simple CSS way to achieve that (here hiding the Bio box):
add_action('admin_head', 'my_custom_admin_css');
function my_custom_admin_css() {
echo '<style>
.user-description-wrap {
display: none;
}
</style>
}
but that obviously applies to ALL user roles.
Is there a way to apply this conditionally based on the role of the user whose profile is being viewed?
current_user_can