I am trying to set up a many to many relationship between a custom post type and the WP users.
I have the CPT "Projects" and the default wordpress Users post type :
- Each Project should has at least one Project Coordinator (which is a User) ;
- Each User may be Project Coordinator for various Projects.
Thank you for getting in touch with us. Using Toolset you cannot create relationships between Custom Post Type and Users. But I think there will be a workaround that can help in your case:
1. Each Project should has at least one Project Coordinator (which is a User) ;
==> For this you may use plugin like “Co-Authors Plus” as this will allow you to have multiple users (project coordinators) assigned to a project: https://wordpress.org/plugins/co-authors-plus/
Please note that we do not officially guarantee on working of this 3rd party plugin, I am just sharing this as I noticed a client using it and the basic feature worked fine.
2. Each User may be Project Coordinator for various Projects.
==> This is already covered in WP native, because each user can have multiple posts (projects), rest will be manageable by above plugin.
Hello and thank you for your answer,
This solution doesn't seem to fit because the "author" of the post may not be the same than the "project manager" related to it.
Thank you.
In that case your options are quite limited to build this setup. Using Toolset it's not possible to associate a Custom Post Type to a User Profile directly. The previous given solution in this thread might be helpful, basically this method talks about adding User Fields for each WP user: https://toolset.com/forums/topic/user-relationship-with-a-custom-post-type/#post-318013
I have tried to look for a workaround but could not find anything matching to your case. Its may be possible using some custom code to make it happen. We have some recommended list of service providers here who can help in such cases: https://toolset.com/consultant/
Thank you. I've been thinking this again and I think I'll stay with your first solution, which is using the Author field to create the relation between Projects and Users.
Now I wonder how it would be possible for a User to choose a Project Manager among existing Users while creating a new Project ?
Thank you very much.
Hello and thank,
That's not quite this since there are a lot of Project Managers.
While the Admin creates a new Project, he must be able to choose WHICH Project Manager will Manage this specific project among registered users.
Thank you.
Unfortunately this is not possible. May be you can create Custom post type for Project Manager but again you will not use any Project Manager as a user.
There is no way to choose a post's author threw a CRED form?
==> No, CRED form does not have any Post Author field. Usually the person who submits the form is treated as post author. Even if we have field one post can have one author only.
So it's not possible using Toolset. Its might be possible using some custom code & API but I am not sure how. You may contact recommended Toolset service providers who can help in such cases and work with you directly on this custom approach and custom code stuff: https://toolset.com/consultant/