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

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.

 

Question [Solved] Icon after registered user

3 Posts
2 Users
0 Reactions
635 Views
Posts: 4
Topic starter
(@gitarrenbog)
Active Member
Joined: 1 year 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: 8075
 Asti
Support
(@asti)
Illustrious Member
Joined: 8 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: 1 year ago

Great! Thank you!

Share: