Php 如何审查评论Dokan插件Wordpress

Php 如何审查评论Dokan插件Wordpress,php,wordpress,dokan,Php,Wordpress,Dokan,此代码(如下)审查对产品发表评论的客户的姓名。仅显示名称和姓氏的第一个字母。下面是几颗星。例如,在产品页面的评论部分;如果一个叫Ayhan的人可以发表评论,其他客户会看到他们的名字如下:a****C****但是,这个代码在商店页面>评论中不起作用。因此,客户的名字和姓氏显示准确。我应该为Dokan商店页面添加什么 还有, 文件:://wp-content/plugins/dokan-pro/modules/store-reviews/functions.php 功能dsr\u保存\u存储\u查看

此代码(如下)审查对产品发表评论的客户的姓名。仅显示名称和姓氏的第一个字母。下面是几颗星。例如,在产品页面的评论部分;如果一个叫Ayhan的人可以发表评论,其他客户会看到他们的名字如下:a****C****但是,这个代码在商店页面>评论中不起作用。因此,客户的名字和姓氏显示准确。我应该为Dokan商店页面添加什么

还有,

文件:://wp-content/plugins/dokan-pro/modules/store-reviews/functions.php 功能dsr\u保存\u存储\u查看

查看列表显示为:render\u review\u list

[

我的代码是:

add_filter('get_comment_author', 'my_comment_author', 10, 1);
function my_comment_author( $author = '' ) {
// Get the comment ID from WP_Query
$comment = get_comment( $comment_ID );
if (!empty($comment->comment_author) ) {
if($comment->user_id > 0){
$user=get_userdata($comment->user_id);
$author = mb_substr($user->first_name, 0, 1, 'UTF-8').'***'.' '.mb_substr($user->last_name, 0, 1, 'UTF-8').'***';
} else {
$author = mb_substr($user->first_name, 0, 1, 'UTF-8').'***'.' '.mb_substr($user->last_name, 0, 1, 'UTF-8').'***';
}
} else {
$author = $comment->comment_author;
}

return $author;
}