I am running mutiple forms on a single page, they all submit and then force dowenload a pdf.
When I had a single form it was working, then I added additional forms and the dowenload stopped working.
Just as an example since you can't see the php code
add_filter("gform_validation_message_2", "change_message", 99, 2);
add_filter("gform_ajax_spinner_url_2", "spinner_url", 10, 2);
add_action("gform_post_submission_2", "post_submission_2", 99, 2);
function change_message($message, $form){
return '';
}
function spinner_url($image_src, $form){
return "";
}
function post_submission_2($lead, $form) {
$data = '/pdf/DesignGuide.pdf';
$name = 'MegaDome-Design-Guide.pdf';
force_download($name, $data);
}
Everything works as expected, except now for some reason the pdf if around 20kb, which is just an empty corrupt pdf.
I haven't changed anyhting else except the forms, so I'm not sure whast it could be.
any thoughts?