Added transition_post_status hook to do the heavy lifting.