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
//disable tinyMCE | |
//add_filter( 'user_can_richedit' , '__return_false', 50 ); | |
add_filter('user_can_richedit', function( $default ){ | |
global $post; | |
if( $post->post_type === 'page') return false; | |
return $default; | |
}); |
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
//redirect to thank you page | |
function mycustom_wp_footer() | |
{ | |
echo '<script type="text/javascript">'; | |
echo 'document.addEventListener( \'wpcf7mailsent\', function( event ) {'; | |
echo 'window.dataLayer.push({ | |
"event" : "cf7submission", | |
"formId" : event.detail.contactFormId, | |
"response" : event.detail.inputs | |
});'; |
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
document.addEventListener( 'wpcf7mailsent', function( event ) { | |
var formTitle; | |
switch(event.detail.contactFormId) { | |
case '2659': formTitle = 'AGI Home Contact'; | |
break; | |
case '2633': formTitle = 'AGI Home Display'; | |
break; | |
case '3387': formTitle = 'AGI Home No Rank Question'; |
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
//redirect to thank you page | |
function mycustom_wp_footer() | |
{ | |
echo '<script type="text/javascript">'; | |
echo 'var formTitle;'; | |
echo 'switch(event.detail.contactFormId) {'; | |
echo 'case "14567": formTitle = "Contact Form"; formThank: "thank-you"'; | |
echo 'break;'; | |
echo 'case "14683": formTitle = "Service Requests"; formThank: "thank-you-service"'; | |
echo 'break;'; |