• After updating wordpress, theme and plugin, the fields defined as dropdown select no longer return the selected value but the ARRAY string.

    I customized the wpcf7_before_send_mail method in function.php to save the data sent by post (with attached file) to a txt file.

    add_action(‘wpcf7_before_send_mail’, ‘my_get_form_values’, 10, 1);
    // define the callback function
    function my_get_form_values($contact_form){
    // get info about the form and current submission instance
    $formTitle = $contact_form->title();
    $submission = WPCF7_Submission::get_instance();

    $posted_data = $submission->get_posted_data();

    $dati_inseriti = $posted_data[‘cognome’];

    $dati_inseriti .= “\n” . $posted_data[‘statocivile’];

    }

    ‘statocivile’ is a dropdownselect and before update $posted_data[‘statocivile’] returns selected value ‘celibe’,’sposato’,’vedovo’. Now it returns ‘Array’. Why???

    All the dropdown SELECT of the form return Array???

    Can you help me? Thanks

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Try this,

    $dati_inseriti .= “\n” . isset($posted_data[‘statocivile’][0]?$posted_data[‘statocivile’][0]:”;

Viewing 1 replies (of 1 total)
  • The topic ‘get_posted_data() return “ARRAY” and not selected value in dropdown SELECT’ is closed to new replies.