Skip Navigation

[Resolved] How can I delete an entry for a repeatable field group?

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

Problem:

Display Shortcode [cred_delete_post_link] for custom user role.

Solution:

Since you are using Toolset form shortcode to display the "Delete" links, you need to enable the access control "Delete Own Posts using Toolset Forms" for "Applicant" user role, for example:

https://toolset.com/forums/topic/how-can-i-delete-an-entry-for-a-repeatable-field-group/#post-1191753

Relevant Documentation:

https://toolset.com/documentation/user-guides/access-control-for-cred-forms/

This support ticket is created 5 years, 2 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
- 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 4 replies, has 3 voices.

Last updated by Luo Yang 5 years, 2 months ago.

Assisted by: Luo Yang.

Author
Posts
#1191325

I have a view which lists all of the entries for a repeatable field group. For each of the items being displayed I want to provide a links to edit or delete the item. For the delete link I'm using cred_delete_post_link. Here's the code I'm using in the view.

[toolset-edit-post-link layout_slug='edit-employment-history-item' target='self' class='btn btn-lg btn-primary']Edit[/toolset-edit-post-link] [cred_delete_post_link action='trash' text='Delete' message='Are you sure you want to delete this employment history item?' message_show='1' class='cred-refresh-after-delete']

The edit link is working but the delete link isn't showing up.

#1191438

You can list RFG's (Repeatable Field Groups) and link to the Form that lets you edit that RFG, hence, all the fields included within.
For this you need to create an RFG Edit Form as shown here:
https://toolset.com/documentation/getting-started-with-toolset/creating-and-displaying-repeatable-field-groups/front-end-forms-for-repeatable-field-groups/#forms-for-editing-values-of-existing-repeatable-field-groups

That is then linked in the View listing the RFGs

To directly delete items from within that loop you can use the Post Delete Link as offered by Forms, for example:

[cred_delete_post_link action='trash' text='Delete %TITLE%' message='Are you sure you want to delete this post?' message_show='1']

this, inserted in a view that loops RFG's will directly delete that RFG (note, this includes all the fields within that RFG, just as if you edit the RFG.

I also copy-pasted your version of the delete link to my system and it works great.

I suggest removing eventual custom CSS and HTML/JS to see if it's due to that, or the Theme, or another plugin interfering, or eventually some style conflicts that hide the link.

If you cannot spot the issue, I can have a look, but I would need to log in and eventually also make some test view myself on the site, if this is possible?

#1191753

Hello,

Thanks for the details, Since you are using Toolset form shortcode to display the "Delete" links, you need to enable the access control "Delete Own Posts using Toolset Forms" for "Applicant" user role, I have done below modification in your website:

Dashboard-> Toolset-> Access control-> Toolset Forms

In column "Delete Own Posts using Toolset Forms", enable the checbox for user role "Applicant", please test again, check if it is fixed.

More help:
https://toolset.com/documentation/user-guides/access-control-for-cred-forms/

#1192082

Ah thank you! I don't know how I overlooked that. That takes care of my issue. Thank you!

#1192310

You are welcome

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