I have a custom post type ‘Participant’ with many custom fields. I also have a form with corresponding input fields for the user to fill out. When he submits the form, I want a new post to be generated with each custom fields containing the value chosen by the user.
Is it possible to do and if so, how?
Use wp_insert_post() and add_post_meta(), like this:
In addition to the great answer of @webaware above, this can be handled since wordpress 4.4.0 all via the wp_insert_post call:
This can be achieved quite easily using the Gravity Forms plugin. You can build a form which populates a Custom Post Type in the backend. This post can be set to appear as a draft or as published. No problem adding custom fields. In my case, I used it to gather client testimonials.