raz0r7
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
Forum: Plugins
In reply to: [Contact Form 7] wpcf7_before_send_mail action not firingBTW, “Just and update. I got the action/webhook to fire by” should read “Just an update. I got the action/webhook to fire by placing the action and function in “functions.php”
Forum: Plugins
In reply to: [Contact Form 7] wpcf7_before_send_mail action not firingJust and update. I got the action/webhook to fire by
I want to use the wpcf7_before_send_mail action in a custom page template. Just wondering why it wouldn’t fire even though it does fire if I place the function and action in the theme “functions.php” file.
I am going to use this “cf7_save_to_the_database” function to store my data.
See the code below to see how I am trying to implementing this:
//WP hooks start add_filter('the_content', 'post_page'); //WP hooks end function post_page($content){ global $post; //wordpress post global object write_log("-----------QUIZ TEMPLATE TEST----------"); add_action('wpcf7_before_send_mail','cf7_save_to_the_database', 0); return $content; } function cf7_save_to_the_database($cf7) { write_log("-----------SAVE RESULTS TO DATABASE HERE----------"); $submission = WPCF7_Submission::get_instance(); if ( $submission ) { $formdata = $submission->get_posted_data(); } write_log($formdata); }Everything works fine when I put the action and cf7_save_to_the_database function in the theme “functions.php” file.
– Also, we aren’t using multisite in this wordpress.
Thanx
Viewing 2 replies - 1 through 2 (of 2 total)