[Plugin: Contact Form 7] a fix i wrote – passing vars via get/post
-
I have a quick fix/addon here for contact form 7 that gives you the option to pass parameters to your forms using GET or POST query strings (tested over version 2.4.3). for example, passing the subject into the form would be something like this:
https://www.your-domain.com/contact?subject=Cool Subject
The string should be encoded for best results.Open contact-form-7/modules/text.php
look for (around line 52):
Selec All
Code:
1
$value = (string) reset( $values );
add after:Selec All
Code:
1
if(isset($_REQUEST[$tag[‘name’]])) $value = strip_tags($_REQUEST[$tag[‘name’]]);
You can repeat the fix over textarea.php so textarea’s will also be able to get parameters, its the same fix exactly.https://beny.co.il/blog/contact-7-passing-parameters-via-getpost/
- The topic ‘[Plugin: Contact Form 7] a fix i wrote – passing vars via get/post’ is closed to new replies.