Skip Navigation

[Resolved] I want to register a user and connect it to a new or existing post (c post type)

This thread is resolved. Here is a description of the problem and solution.

Problem:

I want a user to register and to fill in to which company it belongs. The company is a custom post type. It may be a new company, or maybe already in the database. How do I connect the user to the company and the company has some taxonomies. When the user registers himself for the first time, I want it to select the taxonomie in the register form so if the company is new, it can be created with the right taxonomy. I know how I can make checkboxes but I want the register form to get the possible taxonomies from wordpress.

Solution:

Since wordpress users are not a custom post type, so you can not connect user with custom post type "Company" directly, and custom taxonomy does not support WordPress user.

in your case, I suggest you setup another custom post type, for example "Member", use it as intermediate between "company" and user:

1) Each user can create only one post in "Member" post type

2) setup one-to-many relationship between post type "Company" and "Member"

3) After user login into your website, display a page with post view, lists all "Company" posts,

If user can find his own company, show a child post form link to create "Member" post.

If his company is not in company list, show a post form for creating "Company" post.

Relevant Documentation:

https://toolset.com/documentation/post-relationships/how-to-create-custom-searches-and-relationships-for-users/

This support ticket is created 5 years, 9 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
- 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)

Author
Posts
#1203686

Tell us what you are trying to do?
I want a user to register and to fill in to which company it belongs. The company is a custom post type. It may be a new company, or maybe already in the database. How do I connect the user to the company and the company has some taxonomies. When the user registers himself for the first time, I want it to select the taxonomie in the register form so if the company is new, it can be created with the right taxonomy. I know how I can make checkboxes but I want the register form to get the possible taxonomies from wordpress.

Is there any documentation that you are following?
https://toolset.com/documentation/getting-started-with-toolset/publish-content-from-the-front-end/forms-for-registering-users/

What is the link to your site?
hidden link

#1204232

Hello,

I assume one company post can connect to multiple users.

Since wordpress users are not a custom post type, so you can not connect user with custom post type "Company" directly, and custom taxonomy does not support WordPress user.

in your case, I suggest you setup another custom post type, for example "Member", use it as intermediate between "company" and user:
1) Each user can create only one post in "Member" post type
2) setup one-to-many relationship between post type "Company" and "Member"
3) After user login into your website, display a page with post view, lists all "Company" posts,
If user can find his own company, show a child post form link to create "Member" post
If his company is not in company list, show a post form for creating "Company" post.

See our document:
How to Create Custom Searches and Relationships for Users
https://toolset.com/documentation/post-relationships/how-to-create-custom-searches-and-relationships-for-users/

#1210014

My issue is resolved now. Thank you!