Passer la navigation

[Résolu] How to run custom code on CRED delete button press?

This support ticket is created Il y a 1 année et 9 mois. 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 -

Fuseau horaire du supporter : Asia/Kolkata (GMT+05:30)

Ce sujet contient 1 réponse, a 2 voix.

Dernière mise à jour par Minesh Il y a 1 année et 9 mois.

Assisté par: Minesh.

Auteur
Publications
#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
Supporter

Les langues: Anglais (English )

Fuseau horaire: 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!