wpDiscuz 7 API Documentation

  1. Home
  2. Docs
  3. wpDiscuz 7 API Documentation
  4. Filters
  5. wpdiscuz_user_label
Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors


This filter can be used to change the printed user role. The hook works only if the user is not the author of the current post and it doesn’t work for guests.


Since 70.0. version


1. $role (type: string) – the user role
2. $user (type: WP_User object) – the object of the current user


add_filter("wpdiscuz_user_label", function ($role, $user) {
    if ($user->ID == 1) {
        $role = "Boss";
    return $role;
}, 10, 2);

Was this article helpful to you? Yes No