Update post meta using pending_to_publish hook
I tend to make use of the transition_post_status hook as it gives you so much control over what you need to do. Be sure to check out the link for all available status options. What I specially like that the $post object is also passed to the hook, so you can target a specific post … Read more