"; } cfturnstile_field_show('.wpforms-submit', 'turnstileWPFCallback', 'wpforms-' . $form_data['id'], '-wpf-' . $uniqueId); } } // WP Forms Check add_action('wpforms_process_before', 'cfturnstile_wpf_check', 10, 2); function cfturnstile_wpf_check($entry, $form_data) { if(!cfturnstile_whitelisted() && !cfturnstile_form_disable($form_data['id'], 'cfturnstile_wpforms_disable')) { if ( 'POST' === $_SERVER['REQUEST_METHOD'] ) { $check = cfturnstile_check(); $success = $check['success']; if($success != true) { wpforms()->process->errors[ $form_data[ 'id' ] ][ 'header' ] = cfturnstile_failed_message(); } } else { wpforms()->process->errors[ $form_data[ 'id' ] ][ 'header' ] = cfturnstile_failed_message(); } } else { return; } } }