Limited Support
Our team is currently on holiday, so support will be limited during this period. Response times may be slower than usual, and some inquiries may be delayed.
We appreciate your patience and understanding, and we’ll resume our usual support by the end of August.
I'm using a custom field that I added to my comment form and I know from there I can target the meta key with a function. If the key equals a certain value, I want to change or hide that comment author's avatar. The following seems like it should work but it doesn't. Does anyone out there know how to hide or change the avatar within wpDiscuz comments if a custom meta key's value is detected? By the way, I know the custom field is set correctly because I'm able to change the author name, and I was able to add a class based on this custom field. Only the avatar gives me trouble. Also, changing the priority of get_avatar does nothing.
function change_comment_avatar($avatar, $id_or_email, $size, $default, $alt) { $comment = get_comment($id_or_email); $fun_comment = get_comment_meta($comment->comment_ID, 'the_fun_comment', true); if ($fun_comment == 'on') { $avatar = "<img alt='{$alt}' src='example.png' class='avatar avatar-{$size} photo' height='{$size}' width='{$size}' />"; } return $avatar; } add_filter('get_avatar', 'change_comment_avatar', 10, 5);
I'll ask the developers and provide you with an update shortly.
Thank you for looking into it and for future updates!