I am creating a temporary post and passing all its info to an existing post.
I am using cred_save_data to transfer information and cred_success_redirect to direct the user to a custom page.
Is there a hook I can use after the redirect to delete the temporary post?
Hi there,
Toolset does not have any hooks to delete a post. That is something that you can do with a native WordPress function:
https://developer.wordpress.org/reference/functions/wp_delete_post/
For the redirection you can test if this hook can help you:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_redirect_after_delete_action
So basically you will delete the post and after that redirect the customer.
But your method is correct too, and you can just use the WordPress function to delete the post before redirection.
This is a question about custom coding which is outside of our support policy and we will not be able to give code to achieve such functionality. We did our best to give you pointers on how to implement the feature.
Thank you.