Fires when a post is transitioned from one status to another.
Description
The dynamic portions of the hook name, $new_status and $post->post_type, refer to the new post status and post type, respectively. Possible hook names include: <ul> <li>draft_post</li> <li>future_post</li> <li>pending_post</li> <li>private_post</li> <li>publish_post</li> <li>trash_post</li> <li>draft_page</li> <li>future_page</li> <li>pending_page</li> <li>private_page</li> <li>publish_page</li> <li>trash_page</li> <li>publish_attachment</li> <li>trash_attachment</li> </ul> Please note: When this action is hooked using a particular post status (like 'publish', as publish_{$post->post_type}), it will fire both when a post is first transitioned to that status from something else, as well as upon subsequent post updates (old and new status are both the same). Therefore, if you are looking to only fire a callback when a post is first transitioned to a status, use the 'transition_post_status' hook instead.
5877* @since 5.9.0 Added `$old_status` parameter.5878*5879* @param int$post_id Post ID.5880* @param WP_Post$post Post object.5881* @param string$old_status Old post status.5882*/5883do_action("{$new_status}_{$post->post_type}",$post->ID,$post,$old_status);5884}58855886/**5887* Fires actions after a post, its terms and meta data has been saved.5888*5889* @since 5.6.0
History
Introduced in 2.3.0. Unchanged from 6.7.7 through 7.1.0.