Storing form entries in custom DB tables is a cinch when using the Advanced Forms plugin in combination with the ACF Custom Database Tables plugin provided you know how to connect the pieces.
Fortunately, all this can be done from within the WordPress admin so you don’t need any code snippets to make this work.
Step 1: enable entries on the form
First up, create your form and be sure to enable the create entries setting under Form Settings > Entries.
Step 2: Enable the field group on both the form and entries
Next, create a field group for your form fields and in the Location settings you want to have the following rules set up:
- If post type is equal to Entry
- OR form is equal to {your form}
This combination of rules allows the Advanced Forms plugin to map the field group to your form while also allowing the ACF Custom Database Tables plugin to map the field group to a database table.
Step 3: Manage your DB table as usual
In the ACF Custom Database Tables Settings box, enable the Manage Table Definition setting and specify your table name.
From this point, you just need to go through the normal table creation/update process and you’ll then have your form entry data storing to your custom table.