I am using this code to update post meta but it is not working.
function run_when_job_published( $post_id, $post, $update){
$post_meta = get_post_meta($post_id);
}
add_action('save_post_jobs', 'run_when_job_published', 10, 3);
But here in this function $post_meta
is returning an empty array.
Actually I want to update one of the meta field during post insertion but I think it is not possible with this hook. I have also tried publish_post
hook but in my scenario it is not working.
Any suggestion will be much appreciated. Thank you!