Skip to content

Instantly share code, notes, and snippets.

@topdown
Last active December 25, 2016 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save topdown/562290275be0e828bd491a8f4238dd8f to your computer and use it in GitHub Desktop.
Save topdown/562290275be0e828bd491a8f4238dd8f to your computer and use it in GitHub Desktop.
Using contact form 7 action url filter
<?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