I'm looking for a admin hook for posts that gets fired after the post has been saved. The problem: the save_post does not contain the already changed data to the post object. The new changes can only be found in the $_POST array. But I need a way to update the permalink to a external API once the post_name changes. But it will not work since the $post object is still the old one before the save action.
You should be able to hook in after the post has been updated using the priority argument (set to 20 in this example):
add_action( 'save_post', 'your_function', 20, 1 );
function your_function( $post_id ) {
// this should be the updated post object
$post = get_post( $post_id );
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With