Issue with get_posted_data() or $_POST keys
-
Hello,
Can you please help with our issue?
Just noting that are using the latest version of Contact Form 7.
Anyways, we have a custom code to send emails to different addresses depending on the selected enquiry type and role combine.
We use the example code below to get specific data from the submission:
$submission = WPCF7_Submission::get_instance(); $data = $submission->get_posted_data(); $full_name = $data['field_full_name'];This was previously working. However, for some reason, now the keys are incorrect and instead of the field names as keys, the values are now also the keys. And that breaks our code because
$full_name = $data['field_full_name'];doesn’t work anymore.See the result of
$data = $submission->get_posted_data();:
http://files.swishdesign.com.au/gvKR2UlWe tried
WPCF7_Submission::get_posted_data()but it is just returning 500 error on the console.The same goes with the
$_POST, it also returning the same thing as theget_posted_data(), the key is the same as the value instead of the field name:
http://files.swishdesign.com.au/9r5lDo8Can you please suggest any other way to get the submission data during the
wpcf7_before_send_mailhook? Or if this is a bug, can you please look into it soon?I look forward to hearing back from you soon.
Kind regards,
Ethyl
The topic ‘Issue with get_posted_data() or $_POST keys’ is closed to new replies.