Quick Edit regarding lists:
If you are just talking about collecting emails and other info for lists, and those persons are not intended to be users of the site, I would look into posting your form to the service that will be handling the list. Any of the major services would have tutorials regarding "hosting your own sign up form".
In your form, the action
attribute would be a link they provide.
<form action="http://some-link-privided-by-sevice/" method="POST">
And the name
attributes of the input field(s) would correspond to some value on their end as well, since their script would be handling the data submitted.
<input type="text" name="the-name-they-want" value="" />
There will also be some hidden fields required to pass a secret key of some kind generated on their end.
(An example from the service Mailchimp):
<form action="http://mailchimp.us8.list-manage.com/subscribe/post" method="POST">
<input type="hidden" name="u" value="a123cd45678ef90g7h1j7k9lm">
<input type="hidden" name="id" value="ab2c468d10">
//your input fields
//submit button
</form>
Getting Form Data in General
If posting the form to a function of your own, you access those input fields as parts of the $_POST array:
if (isset ($_POST['u'] ) ) {
//do stuff with set value
}
Within wordpress you can utilize wp_ajax_nopriv
for non-logged in users when posting a form to admin-ajax.php: action="<?php echo admin_url('admin-ajax.php'); ?>"
See the linked tutorial below about posting from the front end to adapt it to your needs if that's case.
Other Data Collection
With collecting data from forms, you are, essentially, talking about posting from the frontend of the site.
Something like this tutorial on posting from the frontend should get you in the right direction. The wp-api could be leveraged for this as well (not sure if that tutorial gets into it that or not).
Some more details and things to keep in mind:
I can't speak on the particular plugin you mentioned, but in terms of saving form data to the wordpress database, there are a couple things to consider. Most importantly:
Validating, Sanitizing, and Escaping and the use of nonces
Saving the form entry from the frontend is creating a new post, and adding those custom fields to that post (custom fields are just post meta keys/values). So in addition to wp_insert_post
, it would use update_post_meta()
To easily exclude this type of posting from other posts, I usually relegate it to a specific custom post type for organizational purposes.