Forum Replies Created

Viewing 1 replies (of 1 total)
  • There is a way to fix this without touching the plugin’s core files. Allthough it’s NOT optimal. In your theme’s functions.php, you can catch the $_POST array and check if Contact7 as submitted a form. If a value is missing, just set it to an empty string.

    function check_contact7_values() {
    	$form_elems = array(
    		'my_textfield',
    		'my_other_textfield'
    	);
    
    	foreach ($form_elems as $fe) :
    		if (isset($_POST['_wpcf7']) && !isset($_POST[$fe])) {
    			$_POST[$fe] = '';
    		}
    	endforeach;
    }

    Call it with add_action('init', 'check_contact7_values');

    As stated in the beginning: This is not an optimal solution so let’s hope this gets fixed soon.

Viewing 1 replies (of 1 total)