0

I want to build a webapp using wordpress to manage the fornt-end templating and data input. the app will display a wizard, a map to locate the user and a for to insert some information about the location. I will also add a search form that will look from the data inserted by users and will display the results if found. My question is, how I can save some data to the wordpress database, is there any specific function to let wordpress manage the form inputs? I need to create a separate database table or I can rely on the existing wordpress database tables structure? Can anyone point me into the right direction? I don't have any code sample at the moment, this because I want to understand first how to proceed with the custom form that will be showed to the user to collect the data. Thank you.

0

It's totally depends on your sow. You can choose custom table to insert custom data and that's need so much code like mysql query to insert data and fetching data using the same approach. If you feel comfortable with those approach you can look for wordpress WPDB.

But to me if you want to build a system which store data from the custom form and stores on the table and display on the wordpress admin panel as well then you might need to go with wordpress default conventional tables. By using custom post type. In this way you can easily display the stored data in the admin dashboard as well as admin can easily change , delete it. And that's a default features.

  • Custom post type will not be useful in this case, I need to store personal information of an user so a traditional table will be better than a post that is accessible by anyone – sialfa Dec 31 '19 at 10:14
  • Then you can check wpdb for interacting with mysql – Pradipta Sarkar Dec 31 '19 at 10:50
  • I will read the documentation about it. For the data submit to the backend, is there any particular function I need to follow? I know that to submit data wordpress need some hidden fields – sialfa Dec 31 '19 at 11:15
  • I didn't get your question properly. Could you explain so that I can guide you in a proper way. – Pradipta Sarkar Dec 31 '19 at 15:57
  • Usually wordpress forms require an hidden field to set an action that needs to be associated with a function called by add_action(). I don't remember well the hook to call, but without it if I remember well, wordpress will not manage the data. admin_action or similar – sialfa Dec 31 '19 at 16:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.