Plugin Directory

Custom Status

Add new statuses (created by user interface or from register_post_status() function) to post, page and custom-post.

  • Q: When click "publish" button, my custom status is lost.

  • A: You use "save" button to save post preserving custom status. Else use save_post hook to set correct status when publish

  • Q: Some custom status are not modifiable. Why?

  • A: Coded defined custom status are not modifiable from user interface.

  • Q: I want publish post in a custom status.

  • A: You can use save_post Hook. This function to do this, and define new flow for your posts.

    function my_personal_flow($post_id) {
    if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )   return;

    // more security check...

    if (($_POST['original_post_status']=='draft') && ($_POST['post_status']=='publish') ) $new_post['post_status']='planned'; if (($_POST['original_post_status']=='planned') && ($_POST['post_status']=='publish') ) $new_post['post_status']='executed'; if (($_POST['original_post_status']=='executed') && ($_POST['post_status']=='publish') ) $new_post['post_status']='approved'; if (($_POST['original_post_status']=='approved') && ($_POST['post_status']=='publish') ) $new_post['post_status']='approved'; remove_action( 'save_post', 'my_personal_flow' ); // to remove loop!! wp_update_post($new_post); add_action( 'save_post', 'my_personal_flow' ); // to add filter for next save!! } add_action('save_post','my_personal_flow');

Requires: 3.1 or higher
Compatible up to: 3.5.2
Last Updated: 1 year ago
Active Installs: 200+


3 out of 5 stars


0 of 1 support threads in the last two months have been marked resolved.

Got something to say? Need help?


Not enough data

0 people say it works.
0 people say it's broken.