All Topics
Custom Column – Data attribute not render
Hi,
I Would like to add data attribute in value render like this
return sprintf(
'<label class="toggle-favorite">
<input type="checkbox" class="favorite-toggle" data-post-id="%d" %s />
<span class="slider"></span>
</label>',
esc_attr($post_id),
esc_attr($checked)
);
but the html render is without data-post-id and $checked value.
How can I render the input with data attribute ?
Thanks for your help
You must be logged in to reply to this topic.