[Contact Form 7] the hook 'on_sent_ok' is scheduled to be abolished

When you enter "on_sent_ok" hook to redirect to a custom url after submitting the form successfully in the Contact Form 7 plugin for WordPress, the following error message will appear: 1 configuration error detected in this tab panel.

Please note that the method using on_sent_ok hook is no longer recommended in order to redirect to another URL; this function is scheduled to be abolished by the end of 2017.

Instead, you can embed the following script into your theme’s template file:

document.addEventListener( 'wpcf7mailsent', function( event ) {
location = 'http://example.com/';
}, false );

You know, Contact Form 7 provides several types of custom DOM events. You can utilize the events within your JavaScript code to run a function in a specific situation. Please visit this page for more information on Contact Form 7’s custom DOM event.

It's easy to specify a custom url to which users will be redirected after submissions when using Quform.

Leave a Comment