Title: get_posted_data() return &#8220;ARRAY&#8221; and not selected value in dropdown SELECT
Last modified: October 13, 2020

---

# get_posted_data() return “ARRAY” and not selected value in dropdown SELECT

 *  [DIREZIONE22](https://wordpress.org/support/users/direzione22/)
 * (@direzione22)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/get_posted_data-return-array-and-not-selected-value-in-dropdown-select/)
 * 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](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fget_posted_data-return-array-and-not-selected-value-in-dropdown-select%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  [dhanananjaya](https://wordpress.org/support/users/dhanananjaya/)
 * (@dhanananjaya)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/get_posted_data-return-array-and-not-selected-value-in-dropdown-select/#post-13555720)
 * 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.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [dhanananjaya](https://wordpress.org/support/users/dhanananjaya/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/get_posted_data-return-array-and-not-selected-value-in-dropdown-select/#post-13555720)
 * Status: not resolved