wpDiscuz 7 API Documentation

⌘K
  1. Home
  2. Docs
  3. wpDiscuz 7 API Documentat...
  4. Filters
  5. wpdiscuz_user_role_can_see_comments

wpdiscuz_user_role_can_see_comments

This hook can be used for either enabling or disabling the view of the comment for the current user role

Changelog

Since 7.1.1 version

Parameters

1. $canSeeComments (type: bool) - if the users of the current user role can view the comments or not
2. $role (type: string) - the user role that should be allowed to see the comments or not

Usage

add_filter("wpdiscuz_user_role_can_see_comments", function ($canSeeComments, $role) {
    if ($role === "editor") {
        $canSeeComments= true;
    }
    return $canSeeComments;
}, 10, 2);