The effects of alcohol on
sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Limited Support
Our support team is currently on holiday from December 25, 2025 to January 7, 2026, and replies may be delayed during this period.
We appreciate your patience and understanding while our team is away. Thank you for being part of the wpDiscuz community!
Merry Christmas and Happy Holidays! 🎄
[Solved] if comment author is admin add role class to "wpd-comment-wrap"
(@inumedia)
New Member
Joined: 3 years ago
Hello
If the administrator comment his own post, it's displaying in "author" color in the template, so I wish to replace "wpd-blog-post_author" by "wpd-blog-administrator", for this specific case.
Any function to do it ?
May be by doing something in Jquery based on the "wpd-tooltip" value ?
But I don't know how doing this.
thanks
(@inumedia)
New Member
Joined: 3 years ago
Hi
yes I already did that but the color behind stay as "author" color not as "administrator".
So i'm trying a hook to add the wpd-blog-administrator class if the label is equal to "Administrator"
(@asti)
Joined: 8 years ago
Illustrious Member
Posts: 8205
Jul 12, 2022 2:12 pm
@inumedia,
Please remove the code provided in the previous post and add this one:
add_filter("wpdiscuz_author_title", function ($label, $comment) {
global $post;
$user = get_user_by('id', $comment->user_id);
if ($comment->user_id == $post->post_author && is_array($user->roles) && in_array("administrator",$user->roles)) {
$label = __("Administrator", "wpdiscuz");
}
return $label;
}, 10, 2);
Regarding the colour of the label, you'll be able to change it using custom CSS code with the next version of the wpDiscuz plugin (no ETA). Currently, there is no way to change the colour even with the js code.
(@asti)
Joined: 8 years ago
Illustrious Member
Posts: 8205
Jul 29, 2022 7:46 am
@inumedia,
The new version is ready.