WordPress hook after post content and meta update
save_post and new_to_publish is enough, with some checks, to update post metadata. And you don’t need the redirection. <?php /** * Update Postmeta. * * @param integer $post_id Post ID. */ function wpse355298_job_publish_status( $post_id ) { // Check autosave. if ( wp_is_post_autosave( $post_id ) ) { return $post_id; } // Check post revision. if ( … Read more