***Tell us what you are trying to do?***
I have a post type called "action items" that is associate with two other post types: 90-day plans, and weeks. The idea is you list all the actions you want to take in the 90 days (so they are then associated with a given 90-day plan), then each week you select the action items you want to do in that week (and that would then associate them with the given week).
In summary I want to:
-List all the "action items" associated with a particular 90-day plan post item (I already know how to do this).
-Select several of them at a time (maybe with a check-box, for example).
-Click "Save" or "Submit" and create a new connection between all the selected "action items" and a certain week (probably chosen from a list/dropdown).
***Is there any documentation that you are following?***
I've read over this documentation (https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/) but it seems to only allow working with one post at a time also does not filter the posts the way I'm looking to.
***What is the link to your site?***
goals.brandoncollins.org
Hello,
I assume we are talking about this case:
Three post types:
- 90-day plan
- action items
- weeks
Two post type relationships:
- One-to-many relationship between post types "90-day plan" and "action items"
- Many-to-many relationship between post typs "action items" and "weeks".
You are going to connect multiple "action items" posts with one "weeks" post within one relationship form.
If it is, there isn't such kind of built-in feature within Toolset Forms plugin.
One relationship form can handle only one relationship between "action items" post and "weeks" post.
After user Click "Save" button, pass those selected "action items" IDs value and certain week post ID as POST variables to WordPress, setup custom codes, catch those post IDs, setup the post type relationships with function toolset_connect_posts(), see our document:
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_connect_posts
Connects posts within a given post relationship.
That's helpful. I think the API is the right idea for what I'm looking for.