akira9000
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Forum: Developing with WordPress
In reply to: Passing URL parametersDid you get anywhere with this. I’d appreciate some help, I have exactly the same problem – passing parameter from landing page to following pages.
Forum: Plugins
In reply to: [Contact Form 7] attach files dynamically to Mail(2) possible?Seen this also. As you can probably tell, my PHP is not great. This bit of code only targets a specific form – ID741
add_action('wpcf7_before_send_mail','send_pdf'); function send_pdf( $cf7 ) { $id = $cf7->id(); if ($id==741){ $submission = WPCF7_Submission::get_instance(); $submission->add_uploaded_file('pdf', get_template_directory().'/test.pdf'); } }What can I add to target not just a specific form, but the checkbox items within that form?
Forum: Plugins
In reply to: [Contact Form 7] attach files dynamically to Mail(2) possible?I did see that konsument but when I changed the details the form no longer sends. I added this to my functions file:
add_action( 'wpcf7_before_send_mail', 'my_dynamic_attachments' ); function my_dynamic_attachments($cf7) { //check if it is the registration form if ($cf7->id==630) { // get the dropdown menu value and the corresponding file $filename = uploads/2017/11/test1.pdf($cf7->form['checkbox-233']); $cf7->uploaded_files = array('test1'=>$filename); } }Can you advise where I went wrong?
My form ID is 630, my field ID is checkbox-233 and finally my checkbox ID is test1.
My initial post said a dropdown but it’s actually a set of 3 tickboxes I’m using. My mistake.Thanks for your advise.
Viewing 3 replies - 1 through 3 (of 3 total)