what I want to do: my contact form 7 is very simple. I have a input field and a submit button. I want to manipulate the data from the textfield instead of (or maybe before, but for now just say, instead of) sending an email. let's say I want to add 1 to the number entered and display it on the screen. my cf7:
[number* textfield]
[submit "Senden"]
my functions.php: at the end of my functions.php
, i have the following code.
add_action("wpcf7_before_send_mail", "wpcf7_datamanipulate");
function wpcf7_datamanipulate($cf7) {
$wpcf = WPCF7_ContactForm::get_current();
if (true)
$wpcf->skip_mail = true;
return $wpcf;
}
this works quite well for skipping the mail. perfekt. Now I want to var_dump
or print_r
the content of $wpcf
so I know where the number is stored I entered earlier.
var_dump($wpcf);
doesn't seem to work in the functions.php
- nor does a simple echo
.
I also tried to kill the script right after var_dump()
with die()
, but the content of $wpcf
isn't working.
what can I use to display the data I need to work with in my function?
thanks a lot!