I am in the middle of creating a plugin. The plugin shows a from on the frontend to the end user. I want the data the user enters to be saved into the database. So I created a custom post type.
So now what I am looking for is how can I save data entered into the form as a record in the new custom form type? At which out of the box functions / hooks should I look?
Can anyone give me some direction to a good example?
Thanks.
You’re looking for wp_insert_post(). In your plugin, you’ll just want to add it to your form processing. An example: