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.
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
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?
My issue is resolved now. Thank you!