wpDiscuz 7 API Documentation

  1. Home
  2. Docs
  3. wpDiscuz 7 API Documentation
  4. Filters
  5. wpdiscuz_comment_author
Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages

wpdiscuz_comment_author

This filter can be used for changing the printed comment author name.

Changelog

Since 7.0.0 version

Parameters

1. $authorName (type: string) – the name of the user
2. $comment (type: WP_Comment object) – the current comment object

Usage

add_filter("wpdiscuz_comment_author", function ($authorName, $comment) {
    if ($comment->user_id == 1) {
        $authorName = "Boss";
    }
    return $authorName;
}, 10, 2);

Was this article helpful to you? Yes No