Gravity Forms - Global forms for multisite Gravity Forms - Global forms for multisite wordpress wordpress

Gravity Forms - Global forms for multisite


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 hereadd_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 helphttp://www.endocreative.com/save-gravity-forms-data-custom-database-table/