Skip Navigation

[Resolved] Deleting post type connections on the front end.

This support ticket is created 2 years, 11 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/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by felixP-3 2 years, 11 months ago.

Assisted by: Waqar.

Author
Posts
#2263969

Tell us what you are trying to do?

I am trying to delete the connection between two posts on the Front end.

I use a relationship form to connect two posts, now I would like to have a way, on the front end to delete that connection.

How do you do this?

This is the third time I am asking this question to support staff. The first two went to the documentation staff.

Can I please, please just get an answer?

If it can't be done, just tell me.

If it can be done tell me how.

Thanks.

#2264303

Hi,

Thank you for contacting us and I'd be happy to assist.

> If it can't be done, just tell me.

Yes, it is possible to delete the post-relationship connection using the shortcode "cred-delete-relationship" shortcode:
https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred-delete-relationship

> If it can be done tell me how.

I don't have the exact details about where you'd like to have this remove link/button, but here is an example of a most common use case:

Suppose that your website has a many-to-many relationship between the "Books" and "Shops" custom post types. On a single "Book" post page, you'd like to show the list of related "Shops" and the link to remove its post connection with the current book.

1. You'll create a new post view "View to show the related shops" to show the "Shops" posts and include a relationship filter to show only the results related to the post (book), where this view is shown.

2. In the loop of this view, you can include the title of the shop post and the "cred-delete-relationship" shortcode to remove the connection like this:


[wpv-post-title]

[cred-delete-relationship role_items='$fromViews' relationship='book-shop' redirect='self']Remove this connection[/cred-delete-relationship]

3. The last step would be to include this view in the template that shows the single book page.

As a result, on each single book page, there will be a list of related shops and a link to remove its connection with the current book.

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#2267029

Thanks for your help, this worked.

I still have one more problem.

I have a one to many relationship and I would like to also add a related post type.

What short code do I need use to do this within the view loop?

#2267361

My issue is resolved now. Thank you!