wpDiscuz 7 API Documentation

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

wpdiscuz_author_avatar_field

This filter can be used for changing the printed user avatar ID or email.

Changelog

Since 7.0.0 version

Parameters

1. $authorAvatarField (type: int/string) – the user id or email (this depends on the user role, it can be either user or the guest) of the current comment that is used to get the avatar
2. $comment (type: WP_Comment object) – the object of the current comment
3. $user (type: WP_User object) – the object of the current user
4. $profileUrl (type: string) – the profile URL of the current user

Usage

add_filter("wpdiscuz_author_avatar_field", function ($authorAvatarField, $comment, $user, $profileUrl) {
    if ($comment->user_id == 3) {
        $authorAvatarField = 0;
    }
    return $authorAvatarField;
}, 10, 4);

Was this article helpful to you? Yes No