Saltar navegación

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

This support ticket is created hace 2 años, 9 meses. There's a good chance that you are reading advice that it now obsolete.

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.

Este tema contiene 1 respuesta, tiene 2 mensajes.

Última actualización por Christopher Amirian hace 2 años, 9 meses.

Asistido por: Christopher Amirian.

Autor
Mensajes
#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
Colaborador

Idiomas: Inglés (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.