PHP Warning: Missing argument 3 for wpcf7_special_mail_tag()
-
No other plugins I have installed reference this function or any related wpcf7 hooks.
I have this code as a plugin:
<?php function wpcf7_add_param_to_email($components, $form, $obj) { $components['body'] .= " addon: "; if ($form->id() == 443) { $post_id = wpcf7_special_mail_tag('', '_post_id', ''); $components['body'] .= " " . $post_id; } else { $components['body'] .= " (no post found)"; } return $components; } add_filter("wpcf7_mail_components", "wpcf7_add_param_to_email", 10, 3); ?>$post_idalways seems to be turning “null”, but it shouldn’t be. I just want to get the post ID for the post where the form was completed. The function is definitely being called since the first addition to the mail body is there.I am always getting the warning
PHP Warning: Missing argument 3 for wpcf7_special_mail_tag(), called in <my file> and defined in <my directory>/includes/mail.php on line 340, referer: <my post>But I’m clearly specifying 3 parameters. I have no idea what the 3rd one is even supposed to be, but it’s not missing.
The topic ‘PHP Warning: Missing argument 3 for wpcf7_special_mail_tag()’ is closed to new replies.