wp_after_insert_post vs save_post: Run Code After Meta and Terms Are Sav ...
wp_after_insert_post: run code after meta and terms are saved save_post is the hook everyone knows, and in the block editor it fires too early for many tasks. The editor saves the post through the REST API, and the REST controller writes the post first and the meta fields and terms afterwards. Code on save_post then…