Skip Navigation

[Resolved] Alert on Delete

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 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 1 year, 9 months ago.

Assisted by: Luo Yang.

Author
Posts
#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?
hidden link

#2573247

Hello,

It needs custom JS codes, see below test site:
Login URL: hidden link

Content template:
hidden 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:
hidden link
It works fine