save_post action only when creating a new post
The save_post action also passes three parameters to your callback, one of which being $update which denotes whether the post being saved is an existing post or not. /** * Save post metadata when a post is saved. * * @param int $post_id The post ID. * @param post $post The post object. * @param … Read more