Skip Navigation

[Resolved] Set Many-to-Many Parents in Child Post Form

This support ticket is created 5 years, 5 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by andrei-laurentiuP 5 years, 5 months ago.

Assisted by: Christian Cox.

Author
Posts
#1261061

Tell us what you are trying to do?

I have two custom post types: Stores (Parent) and Portfolios (Child). I have created a Many-to-Many relationship. I would like the user, when posting a new Portfolio, to add the Parent(s) as well. This works if we have a One-to-Many relationship, but for Many-to-Many I don't see any options to produce this directly in the Post Form. Is it possible to add a multi-selector to select multiple Parent Posts in a Child Post Form?

#1261341

Hi, the recommended approach is to create a separate relationship Form to manage M2M relationships: https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/

If you want to build something custom using the Forms API and the Post Relationships API, we have documentation about those available here:
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/
https://toolset.com/documentation/programmer-reference/cred-api/

#1261827

Thanks for the suggestion & guiding. I will have a look into that. Thank you!