Changing post status in one click

You can create your custom button in a function and hook it into post_submitbox_misc_actions and this will add it right above the publish button.

To change the status use wp_update_post in an Ajax function. Give it a try and post back with your code if you run into any problems.

UPDATE:

add_action('post_submitbox_misc_actions', 'send_for_correction_button');
function send_for_correction_button()
{
    //global $post;
    echo '<div id="send-for-correction" class="misc-pub-section"
    style="border-top-style:solid; border-top-width:1px; border-top-color:#EEEEEE; border-bottom-width:0px;">
    <input id="save-post2" class="button button-highlighted"
    type="submit" value="Send for correction" name="save">
        </div>';
}
add_filter( 'wp_insert_post_data' , 'my_filter_handler' , '99', 2 );
function my_filter_handler( $data , $postarr )
{
    if ($postarr['save'] == 'Send for correction')
        $data['post_status'] = 'on-correction';

    return $data;
}

Leave a Comment