Last active
December 25, 2016 20:52
-
-
Save topdown/562290275be0e828bd491a8f4238dd8f to your computer and use it in GitHub Desktop.
Using contact form 7 action url filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('wpcf7_form_action_url', 'wpcf7_custom_form_action_url'); | |
function wpcf7_custom_form_action_url($url) { | |
global $post; | |
// Change the value of $id_to_change to the post id where the form is | |
$id_to_change = 1; | |
if($post->ID === $id_to_change) { | |
// The URL you want to post to | |
return 'wheretopost.asp'; | |
} else { | |
return $url; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment