Last active
July 2, 2019 08:27
-
-
Save gaupoit/920551fb11c53c6afe9b5cbb4dc45f74 to your computer and use it in GitHub Desktop.
PHP Snippet to implement the contact form redirection
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
add_action( 'wp_footer', 'redirect_cf7' ); | |
function redirect_cf7() { | |
?> | |
<script type="text/javascript"> | |
document.addEventListener( 'wpcf7mailsent', function( event ) { | |
if ( '1460' == event.detail.contactFormId ) { // Sends sumissions on form 1460 to the custom thank you page | |
location = 'https://example.com/thank-you/'; | |
} | |
}, false ); | |
</script> | |
<?php |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment