I've a WordPress multi-site network with 20+ sites. and i'm using gravity forms for Contact/Signup/Subscription forms. I would like to create global form for my wordpress multisite installation. Is it possible that gravity forms save the form entries only into the main/parent site? I've tried using switch_to_blog()
in children sites. but it is not working.any help would be appreciated :)
Gravity Forms will not provide support for a single site within a multisite installation that is not using an Elite or Developer license type. We will continue to provide support for a single site within a multisite that has an Elite or Developer license, but where Gravity Forms is not network activated.
Open the Gravity Forms form builder and under Standard Fields you will find the field Page. Simply drag and drop this field into the page editor to add page breaks to your form… Depending on the length of your form, you can then add further page breaks to increase the number of form pages. It's that simple!
Embed a Gravity Form in an iframe on any site. The typical process to embed a Gravity Form on a site where the plugin isn't installed requires: Developing a custom page template with necessary code to output form scripts and styles.
Gravity Forms PricingBasic License: $59 per year * Elite License: $259 per year * Pro License: $159 per year * * Gravity Forms updates and support are provided only for the duration of an active Gravity Forms subscription.
If you duplicate the form into all sites, you can make them all send their data to the main site by including this on the 'child' sites:
$formId = 1; //Put your form id here
add_filter('gform_confirmation_'.$formId, 'gform_confirmation', 10, 4);
function gform_confirmation($confirmation, $form, $entry, $is_ajax) {
//Switch to Main site
switch_to_blog(1);
//Insert the entry into the main site
$new_entry_id = \GFAPI::add_entry($entry);
//Switch back
restore_current_blog();
//Tidy up by deleting the entry from THIS site
$result = GFAPI::delete_entry($entry['id']);
return $confirmation;
}
Gravity forms stores data based on blog database table prefix,
in multisite all sites uses the same database but data are separated based on table prefix, the prefix are something like, wp_1_, wp_2_, wp_3_.....
if you have a site, like my.blog1.com with table prefix, wp_1_, gravity form store all the form entries of my.blog1.com to wp_1_rg_lead, wp_1_rg_lead_detail, wp_1_rg_lead_detail_long,
Now if you want to save those details on your parent install, you need to play around with the database and modify gravity form using hooks like gform_pre_submission
or gform_after_submission
This post might help http://www.endocreative.com/save-gravity-forms-data-custom-database-table/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With