Contact Form 7 missing on_submit hook?
-
In the additional_settings section of each form, you can use
on_sent_ok, but is there a similaron_failure, or even just anafter_submission?I’ve looked through the code, and in the
scripts.jsfile there’s a section for “callbacks” using theonSentOkaspect of the response (refers toon_sent_okayfrom additional_settings, and another identical section for processingonSubmit(which was reported in v2.0.6 changelog). However, I can’t find any mention ofonSubmitoron_submitin the rest of the code, and adding something likeon_submit: alert('testing here');does nothing.Once I “manually” attach the setting to the ajax response with the following, it works.
Pastebin: http://wordpress.pastebin.ca/2158913
add_filter( 'wpcf7_ajax_json_echo', array(&$this, 'ajax_results_append') ); public function ajax_results_append($items, $results){ global $wpcf7_contact_form; $items['onSubmit'] = $wpcf7_contact_form->additional_setting( 'on_submit', false ); // send it back because it's a filter return $items; }Is this a bug, or am I missing something?
The topic ‘Contact Form 7 missing on_submit hook?’ is closed to new replies.