Change WordPress user roles and capabilities › Forums › How to or FAQ › quick edit and permalink disable for role › Reply To: quick edit and permalink disable for role
16/05/2018 at 14:09
#4861
Vladimir
Keymaster
It’s better to use current_user_can() for checking if capability was granted to a user or it was not. To check if user has role it’s more correct to use this code:
$user = wp_get_current_user();
if (in_array('some_role_id', $user->roles)) {
// do something
}