Title: dropdowns returned as array
Last modified: September 7, 2020

---

# dropdowns returned as array

 *  [kubiq](https://wordpress.org/support/users/kubiq/)
 * (@kubiq)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/dropdowns-returned-as-array/)
 * In recent updates something changed and when I process form data with wpcf7_before_send_mail
   hook and use standard
    $submission = WPCF7_Submission::get_instance(); $data 
   = (array)$submission->get_posted_data(); then before where there was drop-down,
   I received single entry value, but now it returns array This change broke many
   websites, forms, payments, etc…

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [robrandell](https://wordpress.org/support/users/robrandell/)
 * (@robrandell)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/dropdowns-returned-as-array/#post-13499306)
 * Hi,
    I have the same issue.
 * $posted_data = $submission->get_posted_data();
    $post_title = array(‘post_title’
   => $posted_data[ ‘yourtitle’ ], …)
 * The above used to return ‘Mr’, ‘Mrs’, etc. It now returns ‘array’ after the update.
   The dropdown values are used for routing custom emails to various recipients 
   and this process is now broken. I can confirm that single text fields seem unaffected.
 * EDIT: It appears that the dropdown value are now returned wrapped within array,
   the selected value is simply at the zero key, ie. $posted_data[‘yourtitle’][0].
 * Thanks.
    -  This reply was modified 5 years, 7 months ago by [robrandell](https://wordpress.org/support/users/robrandell/).
    -  This reply was modified 5 years, 7 months ago by [robrandell](https://wordpress.org/support/users/robrandell/).
 *  [TheWebmom](https://wordpress.org/support/users/thewebmom/)
 * (@thewebmom)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/dropdowns-returned-as-array/#post-14060523)
 * Did either of you get this fixed? My database is full of “array” entries instead
   of the chosen checkbox. Did you figure out what files to edit and how?
 * Thanks in advance.
 *  [robrandell](https://wordpress.org/support/users/robrandell/)
 * (@robrandell)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/dropdowns-returned-as-array/#post-14061853)
 * If you are using the standard ‘wpcf7_before_send_mail’ hook to process the submission
   data, the submitted values are wrapped within an array and you can return the
   value simply be referencing the zero key, i.e. $posted_data[‘fieldname’][0]. 
   I am unsure if this applies to checkbox groups in the same way, it seems to work
   for all other form fields though. You could try $posted_data[‘checkboxgroup’],
   $posted_data[‘checkboxgroup’][‘checkboxvalue’] or $posted_data[‘checkboxgroup’][‘
   checkboxvalue’][0] and see if that helps.
 * Thanks.
    -  This reply was modified 5 years, 3 months ago by [robrandell](https://wordpress.org/support/users/robrandell/).
    -  This reply was modified 5 years, 3 months ago by [robrandell](https://wordpress.org/support/users/robrandell/).

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘dropdowns returned as array’ 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/)

 * 3 replies
 * 3 participants
 * Last reply from: [robrandell](https://wordpress.org/support/users/robrandell/)
 * Last activity: [5 years, 3 months ago](https://wordpress.org/support/topic/dropdowns-returned-as-array/#post-14061853)
 * Status: not resolved