07-27-2023, 10:34 AM
I have a custom post type called "videos", which also has a few custom fields defined. Upon creating or updating a "videos" post, I would like to run a function.
Unfortunately, this function needs the values of the post meta data for the post that I've just created, and the usual hooks (`save_post`,`publish_post`, etc.) seem to run before the post meta is inserted into the database, so it isn't available.
If I manually update the post just by clicking "Publish" without making any changes, function works properly.
**Is there a hook that fires later in the process, after all metadata has been inserted?**
Unfortunately, this function needs the values of the post meta data for the post that I've just created, and the usual hooks (`save_post`,`publish_post`, etc.) seem to run before the post meta is inserted into the database, so it isn't available.
If I manually update the post just by clicking "Publish" without making any changes, function works properly.
**Is there a hook that fires later in the process, after all metadata has been inserted?**