Title: get_posted_data returns wrong array
Last modified: February 22, 2018

---

# get_posted_data returns wrong array

 *  [formulaclick](https://wordpress.org/support/users/formulaclick/)
 * (@formulaclick)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/get_posted_data-returns-wrong-array/)
 * Hi,
 * I’m using last version of plugin (5.0). I want to modify dynamically the email
   address where is sent. I have this function for test purposes:
 * add_action( ‘wpcf7_before_send_mail’, ‘action_wpcf7_before_send_mail’ );
    function
   action_wpcf7_before_send_mail( $contact_form ) { if (1093 == $contact_form->id()){
 *  $wpcf7 = $contact_form::get_current();
    $submission = WPCF7_Submission::get_instance();
   if ($submission) { $posted_data = $submission->get_posted_data(); $mail = $wpcf7-
   >prop(‘mail’); $mail[‘body’] .= print_r($posted_data,true); $wpcf7->set_properties(
   array( “mail” => $mail )); return $wpcf7; } } };
 * I want to capture posted data, and I get the array but this way:
 * Array
    ( 1093 => 1093 5.0 => 5.0 es_ES => es_ES wpcf7-f1093-o1 => wpcf7-f1093-
   o1 0 => 0 eeepeee => eeepeee [trtrt@dfsf.com](https://wordpress.org/support/topic/get_posted_data-returns-wrong-array/trtrt@dfsf.com?output_format=md)
   => [trtrt@dfsf.com](https://wordpress.org/support/topic/get_posted_data-returns-wrong-array/trtrt@dfsf.com?output_format=md)
   fsdf asfsdfsf => fsdf asfsdfsf )
 * The array keys have same values as de array values, so I can’t capture data. 
   Anyone experience the same behavior?
 * Is this a bug?
 * Thanks

Viewing 1 replies (of 1 total)

 *  [Johnny52](https://wordpress.org/support/users/johnny52/)
 * (@johnny52)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/get_posted_data-returns-wrong-array/#post-10523525)
 * Hi,
    Hours of searching for a solution……Having the same issue !

Viewing 1 replies (of 1 total)

The topic ‘get_posted_data returns wrong 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/)

## Tags

 * [post](https://wordpress.org/support/topic-tag/post/)
 * [submission](https://wordpress.org/support/topic-tag/submission/)

 * 1 reply
 * 2 participants
 * Last reply from: [Johnny52](https://wordpress.org/support/users/johnny52/)
 * Last activity: [7 years, 10 months ago](https://wordpress.org/support/topic/get_posted_data-returns-wrong-array/#post-10523525)
 * Status: not resolved