If canview is set to false, the current user will not be able to view the custom field values.
Changelog
since 7.6.20 version
Parameters
1. $canView – if true the user can view fields ( globally )
2. $currentUser – the current user
Usage
add_filter("wpdiscuz_user_can_view_fields", function ($canView, $currentUser) { if (!empty($currentUser->roles) && is_array($currentUser->roles) && in_array('author', $currentUser->roles)) { $canView = false; } return $canView; }, 10, 2);