1
1
16dnovikov2019-07-09 14:32:37
Spreadsheets
16dnovikov, 2019-07-09 14:32:37

Wordpress - creating a table to be populated by site guests/users (not via PU)?

Everyone, good afternoon!
From time to time during the last 2 weeks I have been digging Google in search of information on my issue (further expanded).
I need to create a form on the site with certain fields, which will be filled in by site users. In addition to this, you need a separate page (not in the WP control panel) on which there will be all the data from previously completed forms in the form of a table that registered users will see.
So far, the only idea that came to me is to dig into the code of the ninja forms plugin (it is still used for other purposes on the site) and figure out how to display it on the external page of the site.
I also came here with the hope that someone has already encountered a similar question and perhaps tell me the answer.
P.S. If there is already an answer on this site, I'm sorry, apparently I'm not formulating a question for the search form =)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Zhuk, 2019-07-09
@ivan_zhuck

Long option
1. First you need to create a separate type of posts for this data. Function: register_post_type
2. Then you need to prepare the form in the client side and send it to the server, for example, via wp_ajax
3. Next, in the form handler, you need to save the data as posts of the type created in step 1 via the wp_insert_post and update_post_meta functions
4. Then it remains to make the page and display data on it via WP_Query
If there is already a form on ninja forms, then you can get the data contained in the submits and display on the desired page, examples are in the plugin documentation: https://developer.ninjaforms.com/codex /submissions/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question