WordPress 2.3 introduces some new actions that plugins can use to hook into status transitions and workflow. Before, WP had a ‘private_to_published’ action that announced that a post moved from private to published, and that’s about it. Now WP has actions for every possible transition. These actions are of the form ‘status_to_status’ where status is one of:
When a ‘pending’ post is published, the action ‘pending_to_publish’ is triggered. The action is accompanied by the post object that is changing status.
A generic ‘transition_post_status’ action is also emitted for every status change. It is accompanied by the new status, the old status, and the post object. Plugins can use this action to attach a function that intercepts all status changes.
The final action triggered during a status change is of the form ‘status_object’, where status is from the status list above and object is either ‘page’ or ‘post’. For example, when a post is published, a ‘publish_post’ action is triggered. The action is accompanied by the post ID and post object.
See the function wp_transition_post_status() for how these actions are formed. Use add_action() to attach functions to these actions.