This code enables you to add icons to each checkbox choice. The icon and name for each choice is only displayed when the checkbox is checked.
Here’s the checkbox choice values available from the edit screen :
And here’s an example of whats shown on the front end :
If nil checkboxes are checked, the title and choices do not display.
You can use Dashicons however they are limited so you may find Font Awesome provide a larger range of icons to choose from.
Register or login to access the code for members :
Is it possible to use the same code for a plugin/widget?
Not clear to me what you mean by plugin/widget.