Created
October 10, 2018 17:48
-
-
Save KustomDeveloper/da434f78ea97018576cc5b5c34f26f25 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| function redirect_cf7() { | |
| ?> | |
| <script type="text/javascript"> | |
| document.addEventListener( 'wpcf7mailsent', function( event ) { | |
| if ( '947' == event.detail.contactFormId ) { // Sends sumissions on form 947 to the first thank you page | |
| location = 'https://www.example.com/thank-you-1/'; | |
| } else if ( '1070' == event.detail.contactFormId ) { // Sends submissions on form 1070 to the second thank you page | |
| location = 'https://www.example.com/thank-you-2/'; | |
| } else { // Sends submissions on all unaccounted for forms to the third thank you page | |
| location = 'https://www.example.com/thank-you-3/'; | |
| } | |
| }, false ); | |
| </script> | |
| <?php | |
| } | |
| add_action( 'wp_footer', 'redirect_cf7' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment