Please see below for my solution so far. Perhaps it will help somebody out.
// executes when a listing is saved
function on_save_listing( $post_id, $post, $update ) {
// get the author id
$author_id=$post->post_author;
$updated = ($update) ? "updated" : "saved";
if ($updated=='saved') {
// do what you need to do here
// this will run when a gd_place post is saved
}
}
add_action( 'save_post_gd_place', 'on_save_listing', 10, 3 );
I ended up compensating since I don’t know when the listing is saved for the first time. Instead, i am using the following hook to do some more stuff when the listing is published (which should only happen once in theory).
function on_publish_listing( $post_id, $post ) {
//get author id
$author_id=$post->post_author;
//do some stuff here..
}
add_action( 'publish_gd_place', 'on_publish_listing', 10, 2 );