The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Icon after register...
 
Share:
Notifications
Clear all

Question [Solved] Icon after registered user

3 Posts
2 Users
0 Reactions
350 Views
Posts: 4
Topic starter
(@gitarrenbog)
Active Member
Joined: 7 months ago

Hello,
is it possible to insert a small icon / image after the username for a specific role (registered user)?
I can change the CSS file, but I can't find where the query for the different roles is.
Thanks for the help.
Stefan

2 Replies
Asti
Posts: 7661
 Asti
Support
(@asti)
Illustrious Member
Joined: 7 years ago

Hi,

You can use the hook code below: 

add_filter("wpdiscuz_after_comment_author", function ($html, $comment, $user) {
    if (!empty($user->ID) && !empty($user->roles) && is_array($user->roles)) {

        if (in_array('author', $user->roles)) { // if user has the role : author
            $html .= ' <img src="https://www.svgrepo.com/show/13644/avatar.svg" width="18" height="18" />';
        } else if (in_array('editor', $user->roles)) { // if user has the role : editor

        }
        // and so on..
    }
    return $html;
}, 10, 3)

Please note it's just an example you should customize it. 

Posts: 4
Topic starter
(@gitarrenbog)
Active Member
Joined: 7 months ago

Great! Thank you!

Share: