How can I put a checkbox in the post editor
Your code is correct and is ready for a number field. To make it work for a checkbox, you just need to change the type attribute of the input element from number to checkbox and manage the checkbox state. I think this should work: add_action( ‘add_meta_boxes_post’, “spiaggia_add_meta_box” ); function spiaggia_add_meta_box(){ add_meta_box( “spiaggia_meta_box”, __( “Checkbox Title”, … Read more