Skip Navigation

[Resolved] Which form hook can I use to delete a temp post?

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

This topic contains 1 reply, has 2 voices.

Last updated by Christopher Amirian 1 year, 5 months ago.

Assisted by: Christopher Amirian.

Author
Posts
#2488945

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?

#2490559

Christopher Amirian
Supporter

Languages: English (English )

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.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.