wpDiscuz - WordPress Comment Plugin
Share:
Notifications
Clear all

User labels how to display more.


Vdominik17
Posts: 3
Topic starter
(@vdominik17)
New Member
Joined: 1 year ago

Hi!

How can I display more user labels? Example: the author also admin, also display the admin not only the author.. Its possible? 

Many thanks,

Dominik.

Topic Tags
6 Replies
Asti
Posts: 3556
 Asti
Support
(@asti)
Support member
Joined: 4 years ago

Hi @vdominik17,

You can use the following hook to display the secondary role: 

wpdiscuz_after_label
Reply
Vdominik17
Posts: 3
Topic starter
(@vdominik17)
New Member
Joined: 1 year ago

Hi!

Thanks for the reply, and where to enter this?

Many thanks, 

Dominik.

Reply
3 Replies
Asti
 Asti
Support
(@asti)
Joined: 4 years ago

Support member
Posts: 3556

@vdominik17,

You should create a custom code and put it in the active theme functions.php file. 

Please see the example here: https://wpdiscuz.com/docs/codex/filters/wpdiscuz_after_label/

Reply
Vdominik17
(@vdominik17)
Joined: 1 year ago

New Member
Posts: 3

@asti

I try that but Its not work.. 

add_filter("wpdiscuz_after_label", function ($afterLabelHtml, $comment) {
if ($comment->user_id && class_exists('userpro_api')) {
$afterLabelHtml .= userpro_show_badges($comment->user_id, $inline = true);
}
return $afterLabelHtml;
}, 110, 2);
Reply
Asti
 Asti
Support
(@asti)
Joined: 4 years ago

Support member
Posts: 3556

@vdominik17,

The code provided in the doc is just an example. You should create your custom code based on the example and make it work. 

Reply
hokx
Posts: 3
 hokx
(@hokx)
New Member
Joined: 1 year ago

maybe you could add this feature in the next major update? 😀

Reply
Share: