Created
January 30, 2019 19:53
-
-
Save cwylie0/b902ce8febde536c390d559f1ac9d618 to your computer and use it in GitHub Desktop.
Contact Form 7 Redirect to URL Function
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
/* The following function is the new method to redirect to a thank you page after contact form 7 submission. Add it to the functions.php file of your theme. */ | |
add_action( 'wp_footer', 'redirect_cf7' ); | |
function redirect_cf7() { | |
?> | |
<script type="text/javascript"> | |
// Insert your redirect URL as the location below. | |
document.addEventListener( 'wpcf7mailsent', function( event ) { | |
location = 'http://careers.ifixyouri.com/thank-you/'; | |
}, false ); | |
</script> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment