Saltar navegación

[Resuelto] How to run custom code on CRED delete button press?

This support ticket is created hace 1 año, 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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Zona horaria del colaborador: Asia/Kolkata (GMT+05:30)

Este tema contiene 1 respuesta, tiene 2 mensajes.

Última actualización por Minesh hace 1 año, 9 meses.

Asistido por: Minesh.

Autor
Mensajes
#2653091

I am using CRED_DELETE_POST like this

[cred-delete-post type="button" onsuccess="123" action="delete"]Delete this[/cred-delete-post]

The post gets deleted just as planned. But, I would like to run custom code during the post deletion process. How can I hook custom code with the button press for delete post?

#2653197

Minesh
Colaborador

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Toolset offers form hook "cred_redirect_after_delete_action" you can add your custom code and check if that help you to resolve your issue.
- https://toolset.com/documentation/programmer-reference/cred-api/#cred_redirect_after_delete_action

Otherwise, you can use the standard WordPress "post_updated" hook where you have luxury to check before and after post status and you can hook in your custom code accordingly.

More info:
=> https://codex.wordpress.org/Plugin_API/Action_Reference/post_updated

#2653923

Issue is resolved. Thank you!