Thank you for your reply.
I have tried this hook but it seems to append before the meta data from Toolset are saved.
This is the only meta that are saved when I call this hook :
(
[_edit_lock] => Array
(
[0] => 1663142585:1
)
)
Perhaps we can find an alternative what exactly are you trying to do ? Is it that you want to interact with the values of the custom fields and taxonomy when the post is being saved?
I've checked around and wasn't able to find a suitable hook.
Please let me know so I can see if an alternative is possible.
When a specific custom post type is created,
I need to send a notification to a certain group of users, based on a taxonomy of the new post.
I want to send this notification just once.
The problem with the "save_post", "post_updated" and "wp_after_insert_post" is that the parameter "updated" which is supposed to inform if the post is created or updated is "buggy", it is always true whatever the situation.
So I have created a new meta "wpcf-notification-send" that I want to update as "true" when I have send the notification.
But if I update this meta within the before mentioned hooks, it is overwrite by Toolset because the hooks append before the meta are saved.
That leads to my question "Which hook fires after meta data and custom taxonomy have been saved ?"
I'm unsure of the hook that does this, however I do know with our Toolset forms plugin you can setup the notifications with the custom field values. This will require that you create your posts on the frontend using the Post Forms.
However based on what I see here you're creating the posts on the backend. Why not intercept the POST request for the creation to get the values from that request to push to your notifications.
I did not go in depth in my explanations but the notificationq I need are send to mobile app users through OneSignal, I'm pretty sure it's different from the notifications Toolset is sending from the frontend Post Forms.
I would love to know how to intercept the POST request 😍. Could you explain me how to do that ?
I finally used the wp_after_insert_post hook.
To determine if it was a post creation or an update, I checked the existence of a toolset meta. If it doesn't exist : creation, if it already exist : update