Skip Navigation

[Resolved] Problem Using Relationship API

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

Last updated by julieP 3 years, 4 months ago.

Assisted by: Jamal.

Author
Posts
#2071937

I have a cred_generic_field on a form that displays a list of post titles (from a related post type) and saves the post's ID when the form is submitted (if one of the values has been selected). The relationship is one to many, the edit form is for the child post. The original cred relationship field is included on the form and hidden using CSS. In a cred_save_data hook I'm using the toolset_get_related_post function to get the current related post ID and then using the toolset_disconnect_posts function to remove the current relationship. In a cred_submit_complete hook I then get the ID of the post that was selected and use it to create a new (replacement) relationship for the post. However, the old relationship isn't removed and the new one isn't created. Any idea what the problem might be?

#2071961

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello and thank you for contacting Toolset support.

Well, without more details about it I can't really tell what's the issue. Was this working before or is it your first attempt?

Would you like to reproduce a minimal case in this test site? hidden link

Can you share the custom code that you are using?

#2074837

I took a different approach so not an issue now

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