Support › General › How to modify Checkbox list labels and add custom data-attributesResolved
I am using a custom field of type "Post". I am using it to hold multiple posts references.
As a field type, I am using the Checkbox list.
The problem that I am facing is that I do not know how can I modify option labels so that I can include other fields data. Right now post title is being shown with each box.
My second question is that how can I add data-attributes to each list element.
I am stuck, any help will be greatly appreciated. Thanks!
If you want to add something to the choice labels, please follow this documentation https://docs.metabox.io/filters/#rwmb_choice_label
But there is no filter hook to add data attributes to each list element. You can create your own custom field type by following this documentation https://docs.metabox.io/custom-field-type/