Icon in Attribute Options


i wondered if it’s somehow possible to use an font awesome icon (either through html or shortcode) as an attribute option. e.g. i have the attribute as a radio button type with the options yes and no. now i want to show instead of yes a checkmark icon and for no a xmark icon on frontend.

Maybe it’s possible to allow html in those option titles or replace the words yes or no with the icons through javascript or the replace function?

Ok little Google would have helped beforehand, found this solution:

Now the only question is if you think it’s harmless to use this or could really be a potential risk? Like I only have Subscribers and Contributors on my site, no one that could edit or create categories or so.


Everything seems to be going well. The only risk is if users use tags, but you can further restrict the HTML to tags by changing the code. Also, please note that this snippet may not be enough because HivePress sanitizes labels from HTML when rendering.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.