Skip Navigation

[Resolved] CRED delete post link shortcode ‘cred_delete_post_link’ not working after update

This thread is resolved. Here is a description of the problem and solution.

Problem: The cred_delete_post_link shortcode I have been using for some time on my site no longer works after updating my Toolset plugins.

Solution: As of Forms 2.5.6, the cred_delete_post_link shortcode has been deprecated in favor of cred-delete-post.

Relevant Documentation:
https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/

0% of people find this useful.

This support ticket is created 3 years, 7 months ago. 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 3 replies, has 2 voices.

Last updated by simonM-5 3 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#1786651

Hi Support

We have a view containing cred_delete_post_link which seems not to work correctly after the last plugin update. Has something changed? I didn't see anything in the release notes regarding this.

Also I noticed that it is no longer in the documentation, nor is it available to choose from Fields and Views when one is creating a View.

1) Has this been deprecated?
2) Should it be replaced with cred-delete-post? If so,
-- is there any way to present the delete dialogue box using cred-delete-post? I liked this feature as it gives the user a chance to prevent a delete in case they hit the Delete button accidentally
-- can we still use WPML strings within the shortcode?

Below is what we had previously and does not seem to work.

OLD STYLE:
[cred_delete_post_link action='trash' message_after="[wpml-string context='loop-item-in-edit-my-job-ads-view' name='Deletion confirmed']Job Ad deleted[/wpml-string]" message="[wpml-string context='loop-item-in-edit-my-job-ads-view' name='Deletion confirmation']Are you sure you want to delete this Job Ad? This cannot be undone.[/wpml-string]" message_show='1' class='cred-refresh-after-delete'][wpml-string context='loop-item-in-edit-my-job-ads-view' name='Delete Job Ad']Delete Job Ad[/wpml-string][/cred_delete_post_link]

NEW STYLE:
[cred-delete-post action='trash'type='button' style='color: #ffffff; background-color: #a80000; padding: 8px 20px; text-align: center; font-size: 14px; border: none; border-radius: 3px; width: 100%;' onsuccess='self'][wpml-string context='loop-item-in-edit-my-nanny-ads-view' name='Delete Nanny Ad']Delete Nanny Ad[/wpml-string][/cred-delete-post]

I wanted to send you my Debug info as I usually do but when I go to toolset debug, it is empty!?

Thanks and best regards
Simon

New threads created by Christian Cox and linked to this one are listed below:

https://toolset.com/forums/topic/toolset-debug-info-is-empty/

#1786675
Screenshot 2020-09-22 at 23.04.29.png

Here's how it is appearing on the front end, either on hidden link or hidden link, previously just the red button appeared, the user got a full delete confirmation dialogue and the deletion worked beautifully, refreshing the page with a confirmation message to boot.

#1787789

From what I understand, the shortcode for deleting post links with CRED/Forms was refactored in Forms 2.5.6 to facilitate changes that were needed for the new Blocks editor and preview. The new cred-delete-post shortcode was created to help with this transition. To answer your questions:
1) Has this been deprecated?
Yes, as of Forms 2.5.6 this has been deprecated.

2) Should it be replaced with cred-delete-post?
Yes, the new shortcode replaces the older version.
-- is there any way to present the delete dialogue box using cred-delete-post? I liked this feature as it gives the user a chance to prevent a delete in case they hit the Delete button accidentally
No, there's no confirmation dialog in the new system but you can set the shortcode to Trash instead of Delete, which would give the User the ability to undo their action in wp-admin if they made a mistake.
-- can we still use WPML strings within the shortcode?
You can still use WPML strings in the contents of the shortcode, but the previous shortcode attribute that was used to display some text after the deletion process is no longer available, so you cannot use WPML strings in shortcode attributes.

Let me know if you have further questions about this change.

#1787913

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.