Navigation überspringen

[Gelöst] Alert on Delete

This support ticket is created vor 3 years, 2 months. 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

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

Zuletzt aktualisiert von Luo Yang vor 3 years, 2 months.

Assistiert von: Luo Yang.

Author
Artikel
#2572975

Tell us what you are trying to do?
I added a BORRAR (Delete) button to the front end to delete a INSCRIPTO CPT.
I successfully used what this post says: https://toolset.com/course-lesson/deleting-content-from-the-front-end/

but...
When I press the BORRAR button, the post is deleted without alerting me or asking me "are you sure you want to delete this post"

Is there any documentation that you are following?
https://toolset.com/course-lesson/deleting-content-from-the-front-end/

What is the link to your site?
versteckter Link

#2573247

Hello,

It needs custom JS codes, see below test site:
Login URL: versteckter Link

Content template:
versteckter Link
The delete link shortcode:
[cred-delete-post action='trash' onsuccess='2']Delete[/cred-delete-post]

Custom JS codes:

jQuery("a.js-cred-delete-post").on('click', function(event){
    if (confirm('Are you sure ?')) {
      return;
    }
event.stopPropagation();
event.preventDefault();
});

Test it in frontend:
versteckter Link
It works fine