Skip Navigation

[Resolved] connecting users to cpt

This support ticket is created 4 years 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 4 years ago.

Assisted by: Luo Yang.

Author
Posts
#2128259

I am creating a lead management system. We work with call centers that generate leads for us. I have created a cpt "leads" for storing leads. a cpt "centers" for storing call centers and four user roles(agents, centers, managers, master) for adding and managing leads and users. Here are the permissions I have assigned for user roles:

Agents can
1) Add new leads
2) View and comment on their leads

Centers can
1) Add new agents
2) View their agents and their agents' leads

Managers can
1) View and edit all leads
2) Comment on all leads

Master can
1) View, Comment, Add, Edit, Delete All Leads and Centers
2) View, Comment, Add, Edit, Delete Agents and Managers

I want to connect user role "centers" with cpt "centers". Then i will allow "centers" to register new "agents" and manage their agents and their agents' leads.

#2128589

Hello,

I assume each "centers" user can manage only one "centers" post.

If it is, you can setup the "centers" post author as the specific "centers" user.

Then create a page, for example "My centers", display a post view:
- Query "centers" posts
- Filter by post author is current logged-in user:
https://toolset.com/documentation/user-guides/views/filtering-views-query-by-author/

#2129061

Hi,
No, a "centers" user can have many child users(agents) and a "centers" user can manage all the "leads" generated by its "agents".

#2129439

You are asking the question:
I want to connect user role "centers" with cpt "centers"

I suggest you try these:
1) setup "centers" user as the post author of "centers" post,
2) Setup one-to-many relationship between post type "centers" and "agents"
o after "centers" user logged into your website, you can display a page "My centers", in this paly display his own "centers" posts with a view, see my answer above:
https://toolset.com/forums/topic/connecting-users-to-cpt/#post-2128589
In views loop, you can display a child post view:
- Query "agents" posts
- Filter by post type relationship between "centers" and "agents"
https://toolset.com/course-lesson/displaying-related-posts/#displaying-many-related-items
- In views loop, display "agents" post information + edit "agents" post form link