篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php CF7 - Redireccion a diferentes paginas相关的知识,希望对你有一定的参考价值。
add_action( 'wp_footer', 'redirect_cf7' );
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
}
以上是关于php CF7 - Redireccion a diferentes paginas的主要内容,如果未能解决你的问题,请参考以下文章