ACF, Filter and Hooks, Programming, WordPress

Saving the CF7 submission in the Dashboard using ACF

There are numerous plugins available to save and view the cf7 submission in the dashboard. If you want ignore the plugin and write your own code to save the cf7 then follow this article.

I am using acf fields to store the data submitted from cf7.

1. First, create an acf options page. I am creating Cf7 Submissions as my option page where I will list all my form submissions values

2. Create a form using CF7. I am using the default form cf7 provides

3. Create a repeater field in acf to save the form submitted values in the database and assign it to Cf7 Submissions options page

4. CF7 provides hook wpcf7_before_send_mail which enable us to process the  submitted data the way we like before submitting the form. I am using this hook to save the form submission in the dashboard

5. update_field updates the values in the database
We are capturing the previously submitted data, so that we could merge it with the new submitted form values .

Note : The previously saved data’s in the repeater fields are lost if we don’t merge and update it with the new data’s submitted by the form

6.  Check the cf7 submission options page to see the lists of saved submitted form fields in the dashboard

 

Hits: 26

Standard