How to add a checkbox inside the “Publish post” widget?

Hook into post_submitbox_misc_actions and print the checkbox:

add_action( 'post_submitbox_misc_actions', function() {
    ?>
<div class="misc-pub-section">
    <label><input type="checkbox"> click me</label>
</div>
    <?php
});

Wrap the code in a <div class="misc-pub-section">, otherwise the spacing looks a little bit weird.

Examples: language selector, noindex checkbox, public preview checkbox.

Leave a Comment