Skip Navigation

[Résolu] How to refresh page with jQuery after using cred Delete link?

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.

This topic contains 5 réponses, has 3 voix.

Last updated by fionaH Il y a 8 années et 2 mois.

Assigned support staff: emerson.

Auteur
Publications
#134989

Hi

What code do I put in the cred javascript box on a cred form to refresh the page the form is on after delete?

I'm using [cred-delete-post-link text="Delete" action="delete"] in a table view of child posts on a parent page.

#135043

Luo Yang
Supporter

Languages: Anglais (English ) Chinois simplifié (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Hi fionaH,

Do not need extra javascripts, refresh page after using cred Delete link is a build-in feature of CRED,
When you add a CRED delete link, click "Show advanced options", there is a checkbox option " Refresh page after deletion" in the dialog window.

The code like this:
[cred-delete-post-link text="Delete" action="delete" class="cred-refresh-after-delete"]

#143321

Hi

Sorry it took me so long to reply.

Thanks, the delete code above worked on one of the webpages but not the other. I have an intermediary custom post type, 'shift allocations', which are related to 'volunteers' and 'shifts'. The delete refresh code works on the webpage that displays shift allocations by shift but not on the webpage the displays shift allocations by volunteer.

Any help resolving this would be much appreciated.

#144612

Dear Fiona,
It's OK and thanks for the info. Is this form available online? Can I test it? Can you post the URL where the delete code works and also the URL where it's not working?
I would also like to see your CRED admin settings for this. I’ll send you a private email right now asking you for some private information that will help me debug this issue for you. Please check your email in a couple of minutes, and if you don’t get it, let me know so I can send it again. Thanks.

Cheers,
Emerson

#145062

Dear Fiona,
Thanks for the login details. I have done some testing in your site and fix this. Basically what i did is change this line in Volunteers by Shift View FROM:
[php]
[cred-delete-post-link text="Delete" action="delete"]
[/php]

TO:
[php]
[cred_delete_post_link class="cred-refresh-after-delete" text="Delete" action="trash"]
[/php]

Then I delete some post in your exhibition-book-signings-shift-1 page and it works. It refreshes after deleting it. Can you please confirm this is now OK? Thanks.

Cheers,
Emerson

#146186

It works perfectly now! Thanks for you help 🙂