最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

comments - How Does comment_author Filter Work?

programmeradmin1浏览0评论

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 badges
Add a comment  | 

1 Answer 1

Reset to default 1

Sometimes themes call get_comment_author instead, and bypass the comment_author function. Try using that filter instead.

发布评论

评论列表(0)

  1. 暂无评论