Skip to content

Instantly share code, notes, and snippets.

@edheltzel
Created September 18, 2014 16:34
Show Gist options
  • Save edheltzel/d7dde441ab17645468ec to your computer and use it in GitHub Desktop.
Save edheltzel/d7dde441ab17645468ec to your computer and use it in GitHub Desktop.
redirect for contact form 7
// ADD TO FUNCTIONS.PHP OR require get_template_directory() . '/inc/custom_fuctions.php';
<?php
add_action('wpcf7_mail_sent', 'rdm_wpcf7_mail_sent');
function rdm_wpcf7_mail_sent($wpcf7)
{
$on_sent_ok = $wpcf7->additional_setting('rdm_on_sent_ok', false);
if (is_array($on_sent_ok) && count($on_sent_ok) > 0)
{
wp_redirect(trim($on_sent_ok[0]));
exit;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment