I'm building a learning site for kids. And I wonder how to set up the users, relations and roles.
Parents can register normally (email / password) and become customer.
Kids can only be created by parents, using a special made form on their account page. (I will script the registration part in the back-end, kids will get an auto login-link which bypasses the email / password login. (Kids will not have / need their own email address, all communication will go to their parents).
Teachers can register normally (email / password) and become customer.
Parents can connect to teachers, and teachers can connect to parents. To connect, you need to input the secret ID of the person you want to connect to ( 1AS4-34VB-41ED or something like that ), there will NOT be a global lookup / search.
Parents can connect their kids to the teachers with whom they are connected (see line above).
Both parents and teachers can disconnect kids from teachers.
Teachers can group kids in classes.
So, the main question is: how do I setup the different users? User roles or post types? And how can I best organize the relations between the parents, kids and teachers?
Best regards,
Carl.
Hello,
In my opinion, it needs 3 user roles and 4 post types, for example:
1) Setup 3 custom user roles
- Teachers
- Parents
- Kids
Each WP user can have one of above user role, you can setup three different user forms for user to create different user account:
https://toolset.com/course-lesson/creating-forms-for-registering-users/
2) setup 4 custom post types:
- Teachers
- Parents
- Kids
- Classes
You can setup 4 Toolset Post forms for user to create different post type posts:
https://toolset.com/course-lesson/front-end-forms-for-adding-content/
Each teacher user can have only one teacher post
Same as above, each parent/kid can have only one parent/kid post
3) Two post type relationships:
- Many-to-many relationship between Teacher and Kids
- One-to-many relationship between Classes and Kids
You can use Toolset relationship forms for parents/Teachers to setup above post type relationships:
https://toolset.com/course-lesson/front-end-relationship-forms-for-connecting-posts/
More help:
How to Create Custom Searches and Relationships for Users in WordPress
https://toolset.com/course-lesson/how-to-create-custom-searches-and-relationships-for-users/
Thank you, Luo!
The last link - How to Create Custom Searches and Relationships for Users in WordPress - has the answers I needed.