As part of this project i have already created an Institute custom post type which i can see in the admin dashboard.
What i want to do now is link it to the registration form. The logic is that when a user registers there will be an Institute field. In that Institute field they will write their Institute name.
I just want to try and get this to work before thinking about duplicates, variation spelling etc.
When they hit Submit, that Institute name will go on to create a post in the Institute custom post type that we will be able to see in the Admin dashboard.
The form is already set up, and this is the code iv been able to work out so far:
$my_institute = array ( 'post_type' => 'Institute', 'post_title' => $_POST['field_12']['text'], /* field 12 is the text area */ 'post_content' => 'This description is not needed', 'post_status' => 'publish', ); wp_insert_post( $my_institute );
Is this correct, I was assuming it is straightforward and was going to copy and paste this.