Navigation überspringen

[Gelöst] How to run custom code on CRED delete button press?

This support ticket is created vor 1 Jahr, 9 Monaten. 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 -

Zeitzone des Unterstützers: Asia/Kolkata (GMT+05:30)

Dieses Thema enthält 1 Antwort, hat 2 Stimmen.

Zuletzt aktualisiert von Minesh vor 1 Jahr, 9 Monaten.

Assistiert von: Minesh.

Author
Artikel
#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
Unterstützer

Sprachen: Englisch (English )

Zeitzone: 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!