Skip Navigation

[Résolu] Problem Using Relationship API

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.

This topic contains 2 réponses, has 2 voix.

Last updated by julieP Il y a 1 mois et 3 semaines.

Assigned support staff: Jamal.

Auteur
Publications
#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: Anglais (English ) Français (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