• Resolved rconnard

    (@rconnard)


    One more for you Michael.

    This form I’m working with for our wedding RSVP is working great but it needs to be in two languages. I set up the other form with Polylang’s Contact Form 7 plugin but it’s saving to a different database.

    I’m guessing to get them to save to the same database all the fields need to be named the same and then I need to do something like you’ve indicated here: https://cfdbplugin.com/?page_id=747 but I don’t know what!

    By the way, when I search on this forum it returns results for all forums on the WP site, am I missing something?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Michael Simpson

    (@msimpson)

    What you could do is keep both forms, but make sure the field names are the same for each (even though the display name for the field is in a different language). Then you can pull results from both forms in any shortcode or export using form="form1,form2" (name of your forms).

    Or, using the link you cited above, you could add a filter on one of the forms and save it to the other form. (Again the form field names would need to be the same).

    
    function myFilter($formData) {
       if ($formData->title == 'form2 name') {
          $formData->title = 'form1 name';
       }
        return $formData; 
    }
    

    If the form field names were not the same, then you could add additional code to change them each form2 field name to a name in form1.

    add_filter(‘cfdb_form_data’, ‘myFilter’);

    Thread Starter rconnard

    (@rconnard)

    Michael, thank you again. I’m marking this as resolved because your first suggestion solved my problem.

    However, I’m curious about the filter and I’ve tried to put it together but something’s not quite working. I’ve uploaded this screenshot for you. Is there something that I’ve done wrong?

    https://thepicnicwedding.com/images/cfdb_filter_screenshot.png

    Thanks!

    Plugin Author Michael Simpson

    (@msimpson)

    You having registered the function to be called by anything. Forgot this line at the end:

    add_filter('cfdb_form_data', 'myFilter');

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Two Forms One Database’ is closed to new replies.