Review Problem
-
Hello,
This code(below) censors the name and surname of customers who comment on products. Only the first letter of the name and surname is displayed. Several stars appear in the following. However, this code does not work in Store Page>Comments. So, the customers’ name and surname appear exactly. What should I add for the Dokan store page ?
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; }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Review Problem’ is closed to new replies.