The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Custom badge name a...
 
Notifications
Clear all

[Solved] Custom badge name assistance

5 Posts
2 Users
2 Reactions
337 Views
Posts: 7
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@astromono)
Active Member
Joined: 5 months ago
[#11096]

Hello

I’m trying to customize a badge name for a user role. I created this code snippet which is supposed to change the badge name for the "S2member level3" user role  to "Fundador":

add_filter( 'wpdiscuz_user_label', function( $label, $comment ) {
if ( empty( $comment->user_id ) ) {
return $label; // guests or unknown user
}

$user = get_userdata( (int) $comment->user_id );
if ( $user instanceof WP_User && in_array( 's2member_level3', (array) $user->roles, true ) ) {
return 'Fundador';
}

return $label;
}, 10, 2 );

The problem is the badge just says "Member" and it’s not changing the color according to my settings either.

Any assistance you can provide would be greatly appreciated.

Thanks,

Luis


4 Replies
Asti
Posts: 8211
 Asti
Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@asti)
Illustrious Member
Joined: 8 years ago

Hi,

Please go to Dashboard > wpDiscuz > Phrases, open the Comment tab, and update the relevant phrases accordingly.


Posts: 7
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@astromono)
Active Member
Joined: 5 months ago

Thank you very much, Asti!

On a side note, I see that my labels for commenters get cut off after a few characters. Is there a way to make the complete label name show up?

In my case, the label should read "Miembro Fundador", but in the website below you see it gets cut off at "Miembro…"

https://www.astromono.com/gta6-atrasado-a-noviembre-2026/#comments

I was able to change the color of the label using custom CSS.

Thanks!

Luis


1 Reply
Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8211
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@astromono 

In this case, you should also use custom CSS code like this: 

#wpdcom .wpd-comment .wpd-comment-label span{
   white-space: wrap;
   overflow: visible;
}

Posts: 7
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@astromono)
Active Member
Joined: 5 months ago

Thank you so much Asti! It now looks great!!! I’ll keep tweaking the font sizes a bit, but you can mark this topic as SOLVED! Have a great week ahead!


Share: