[Resolved] User registration and post CPT on the same page
This thread is resolved. Here is a description of the problem and solution.
Problem:
The client wants to create a wordpress user and allow that user to create a profile post at the same them when signing up.
Solution:
Unfortunately you won't be able to create a wordpress user and a user profile post at the same time unless custom code is used.
In a case like this the recommendation is to allow the user to first create their wordpress user account and then allow them to create their user profile.
How can I add in one page a user registration form and a post form ( add a post for a post type ) ? The admin should receive an email with all the information.
I am open to creative ideas like a multi-step form or reveal form, the most imporant things is for the user to be able to submit his user details and his post's details
Unfortunately you won't be able to have the user created and the post created at the same time.
You can have the forms on the same page but if the user isn't created nor logged in then the post form will assign the created post to a guest author and not the user who has been created.
So my advice is to create the user first and allow them to log in, then send them to the page to create the post.
Unfortunately no there isn't a way to connect the user fields to the CPT.
Why not allow on the basic user creation form to just have the Username Password and email, then on the profile CPT you have all the custom fields that the user will need to fill out for their profiles
Based on how wordpress registration works the user will need to be created before they create their profile post. It should be noted that the profile post will only be needed if you want to create a search on the frontend where users can search for other profiles.
If its a case where the user profile will only be visible to the currently logged in user then you can setup the user registration with all the required fields.
In a case where you want to have the user profiles searchable then you will need to create a basic user registration form with just username, password and email.
From there after the user is created you can redirect them to the login screen. After they have logged in you can redirect them to their profile page where they will get presented with their profile if they have one or given the form to create their profile.