Title: Can&#039;t get posted_data
Last modified: August 21, 2016

---

# Can't get posted_data

 *  Resolved [drewrawitz](https://wordpress.org/support/users/drewrawitz/)
 * (@drewrawitz)
 * [12 years ago](https://wordpress.org/support/topic/cant-get-posted_data/)
 * Hello,
 * I seem to be having some trouble, I’m trying to receive the posted data and it
   doesn’t seem to be returning anything. Am I doing something wrong?
 *     ```
       function wpcf7_do_something ($cf7) {
           print_r($cf7->posted_data);
       }
       add_action("wpcf7_before_send_mail", "wpcf7_do_something");
       ```
   
 * [https://wordpress.org/plugins/contact-form-7/](https://wordpress.org/plugins/contact-form-7/)

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

 *  [Rob W](https://wordpress.org/support/users/robertark/)
 * (@robertark)
 * [12 years ago](https://wordpress.org/support/topic/cant-get-posted_data/#post-5103354)
 * I was having the same issue… there’s been some major changes in 3.9.
 * See: [http://contactform7.com/2014/07/02/contact-form-7-39-beta/](http://contactform7.com/2014/07/02/contact-form-7-39-beta/)
 * Notice how the access and visibility has changed.
 *  Thread Starter [drewrawitz](https://wordpress.org/support/users/drewrawitz/)
 * (@drewrawitz)
 * [12 years ago](https://wordpress.org/support/topic/cant-get-posted_data/#post-5103402)
 * Thanks so much Rob, that helps a lot.
 *  [Rob W](https://wordpress.org/support/users/robertark/)
 * (@robertark)
 * [12 years ago](https://wordpress.org/support/topic/cant-get-posted_data/#post-5103437)
 * Here’s how you can get the data:
 *     ```
       add_action('wpcf7_before_send_mail', 'my_wpcf7_before_send_mail');
       function my_wpcf7_before_send_mail($form) {
         $submission = WPCF7_Submission::get_instance();
         $data = $submission->get_posted_data();
       }
       ```
   
 *  [tgfrules](https://wordpress.org/support/users/tgfrules/)
 * (@tgfrules)
 * [12 years ago](https://wordpress.org/support/topic/cant-get-posted_data/#post-5103443)
 * Even it’s not my issue – that solved it for me.
 * Thanks Rob 🙂
 *  [Brim](https://wordpress.org/support/users/brim/)
 * (@brim)
 * [12 years ago](https://wordpress.org/support/topic/cant-get-posted_data/#post-5103567)
 * +1 to thanks 🙂
 *  [Snerfus](https://wordpress.org/support/users/snerfus/)
 * (@snerfus)
 * [12 years ago](https://wordpress.org/support/topic/cant-get-posted_data/#post-5103580)
 * Ok, that solved my issue for the posted_data, but it does not work for uploaded_files(
   trying get_uploaded_files(), and it crashes)
    $submission->uploaded_files[‘file-
   787’], also does not work (crash)
 * Thanks
 *  [Snerfus](https://wordpress.org/support/users/snerfus/)
 * (@snerfus)
 * [12 years ago](https://wordpress.org/support/topic/cant-get-posted_data/#post-5103582)
 * Looks like it is $submission->uploaded_files()
    What a huge change for 3.9, would
   have been nice if this was properly documented, its a huge change.
 *  [Rob W](https://wordpress.org/support/users/robertark/)
 * (@robertark)
 * [12 years ago](https://wordpress.org/support/topic/cant-get-posted_data/#post-5103583)
 * I agree, there should be some dev docs instead of browsing through a blog… even
   the blog doesn’t document everything.

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

The topic ‘Can't get posted_data’ 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/)

 * 8 replies
 * 5 participants
 * Last reply from: [Rob W](https://wordpress.org/support/users/robertark/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/cant-get-posted_data/#post-5103583)
 * Status: resolved