Skip Navigation

[Resolved] Disconnect custom post type relationships from frontend or via frontend form

This support ticket is created 4 years, 3 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: Africa/Casablanca (GMT+01:00)

This topic contains 6 replies, has 3 voices.

Last updated by Jamal 4 years, 3 months ago.

Assisted by: Jamal.

Author
Posts
#1804957

Tell us what you are trying to do?

I have a relationship form that is able to connect parent and child posts from the frontend without a problem. However, if I want to disconnect parent and child posts from the frontend, I can't find an option or a way to do so.

This is a core functionality that many require because we build custom sites that allow users to edit/add/update/delete posts frontend.

Is there any documentation that you are following?
https://toolset.com/forums/topic/as-user-i-want-to-disconnect-child-parent-relationship-without-deleting-any-post/
Is there a similar example that we can see?

What is the link to your site?

#1805305

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

You should be able to insert the shortcode that provides a link to delete the connection between posts with the Toolset Forms button.

If you are using the Blocks interface you need to use the Classic block or Fields and Text block to be able to see the Toolset Forms button (beneath an icon).

Please be aware of a current issue where such links are currently only available to users with manage_options permission (e.g. administrators): https://toolset.com/errata/non-administrator-users-cannot-disconnect-related-posts-using-the-delete-relationship-links/

#1805317

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Sorry, it's more complex than that. I was just discussing with the documentation team that we are lacking documentation for this feature, and while checking what's required we determined that you can only generate the delete connection from within a View.

So if you have a many-to-many relationship between, say "lefts" and "rights", then you might add a View to the template for lefts which lists related right posts, and in the output section of that View you can insert (with the Toolset Forms button, as described above) the link to delete the connection with the rights connected to the current left.

Sorry for the confusion. I'm creating an internal ticket for us to review this to see if we can improve the usability, as well as document it.

#1806405

Hi Nigel, thank you for this key information and guidance. I am actually using a View so should be able to get by. However, I think this is something major that your team should consider implementing because a lot of us are using Toolset to create sites where our clients only engage with the WordPress system via the frontend, so technically anything one can do admin side in the WP dashboard as far as adding/editing/updating data should be possible via frontend forms. Look forward to any implementations/updates on this subject.

#1806695

Hi Nigel, I applied the code fix you suggested, but in the View when going to Forms using "Field and Text" there is no "Delete Relationship" Shortcode. Can I get more specific instructions on how to add a "Delete Relationship" or "Disconnect Relationship" shortcode inserted?

#1806853

To better assist you with this issue, we'll need to know what kind of relationship you are working on? One-to-many or Many-to-many?
If it is a Many-to-many relationship, please check if this reply helps.

Otherwise, I wonder if you could allow us temporary access to the website admin area and let us check your setup closely. We'll need to know which view you are working on and what relationship is involved. Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

#1810445

Hello, and my apologies for the late reply, but I do not work on Mondays.

Please check the view, I have added a shortcode that is meant to disconnect the artists from the exhibition:

[cred-delete-relationship role_items='$fromViews' relationship='exhibition-artist' redirect='self']Disconnect[/cred-delete-relationship]

You may use similar shortcode to disconnect artworks, just make sure to use the correct relationship slug.

The shortcode is not available while creating the view with blocks. We have escalated this to our developers and this will be fixed in a coming release.

I hope this helps. Let us know if you have any questions.