Created
January 4, 2019 17:24
-
-
Save KustomDeveloper/7dd0f40176c03b098343b37e4672965e to your computer and use it in GitHub Desktop.
Redirect Contact Form 7
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
| /* | |
| * Redirect Contact Form 7 Submissions | |
| */ | |
| function redirect_cf7() { ?> | |
| <script type="text/javascript"> | |
| document.addEventListener( 'wpcf7mailsent', function( event ) { | |
| if ( '1438' == event.detail.contactFormId ) { // Sends sumissions on form 947 to the first thank you page | |
| location = 'https://www.ivf4everyone.com/thank-you-feedback/'; | |
| } else { // Sends submissions on all unaccounted for forms to the third thank you page | |
| location = 'https://www.ivf4everyone.com/thank-you'; | |
| } | |
| }, 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