WordPress.org

Ready to get started?Download WordPress

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: 2013-7-6
Downloads: 1,744

Ratings

3 stars
3.7 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

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

67,3,2
100,1,1
0,1,0
0,1,0