I want my plugin to add extra text after a comment author's name. For example if they've commented as "Albert", I might want the comments section to display their name as "Albert (genius)".
I'm trying to use the comment_author filter as follows, but it doesn't seem to have any visible effect:
function my_author_filter($author) {
return $author . '( genius)';
}
add_filter( 'comment_author', 'my_author_filter');
Thanks
I want my plugin to add extra text after a comment author's name. For example if they've commented as "Albert", I might want the comments section to display their name as "Albert (genius)".
I'm trying to use the comment_author filter as follows, but it doesn't seem to have any visible effect:
function my_author_filter($author) {
return $author . '( genius)';
}
add_filter( 'comment_author', 'my_author_filter');
Thanks
Share Improve this question asked May 1, 2020 at 20:31 Pierre BastienPierre Bastien 133 bronze badges1 Answer
Reset to default 1Sometimes themes call get_comment_author
instead, and bypass the comment_author function. Try using that filter instead.