This filter can be used for enabling or disabling commenting for specific user roles.
Changelog
Since 7.0.0 version
Parameters
1. $canComment (type: bool) – if the user with the current user role is able to comment or not
2. $role (type: string) – the current user role that should be allowed or disallowed to comment
Usage
add_filter("wpdiscuz_user_role_can_comment", function ($canComment, $role) { if ($role === "editor") { $canComment = true; } return $canComment; }, 10, 2);