1-to-many relationships for custom post types
-
I have an application where I need a one-to-many relationship maintained in a custom post type upon form submit.
Custom Post types:
1. Person
2. PlantsOne person can have multiple plants but one plant can only be assigned to one person.
I want a form to submit and respect this relationship. When the form is submitted I would like the following to happen:
1. Check if the person exists in the ‘PERSON’ custom post type. If not, create the person and get the person_ID.
2. Create the plant in the ‘PLANT’ custom post type.
3. Update the relationship with the new person to plant relation.I know how to code this. What can the plugin do and what/where do I put the code for the rest? Which filters do I use?
Thanks!
CarolineAppreciate the help.
- The topic ‘1-to-many relationships for custom post types’ is closed to new replies.