• Hi,

    We use these hooks to insert error messages of our own, but after updating to version 5.6 it looks like these hooks don’t fire:

    wpcf7_validate_text*
    wpcf7_validate_email*
    wpcf7_validate_textarea*

    You can see here our production site which hasn’t updated yet to the latest version, that the customized messages are displayed: screenshot

    As opposed to our staging site which has the latest version, and displays the generic messages: screenshot

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    See Contact Form 7 5.6 Beta

    To developers: the existing filter-based validation mechanism will continue to work. If you have created custom validation filters, you don’t need to modify them (they only work for the server-side validation, though).

    Thread Starter Lea

    (@leac)

    Thank you for the swift reply.

    If the mechanism still works, what could be the cause of it not working in our staging site?

    I have a similar issue. Prior to update 5.6 I was using this line of code to stop validation on radio buttons:

    remove_filter('wpcf7_validate_radio', 'wpcf7_checkbox_validation_filter');

    But after the update, radio buttons are being validated again. Any ideas what could be causing this?

    Same problem here since the update to 5.6.1 version. wpcf7_checkbox_validation_filter not working anymore.

    Thread Starter Lea

    (@leac)

    @takayukister I’ve searched the cf7 plugin codebase and haven’t found those filters. In previous versions those filters were in \contact-form-7\modules\textarea.php and \contact-form-7\modules\text.php.

    Maybe if you could tell me where these filters are in this version, I could try to debug the issue myself.

    Yeah I don’t think the validation works anymore, not sure why but just almost anything is let through.

    I tried the most basic

    	
    	if(empty($_POST[$tag->name]) || strlen($_POST[$tag->name]) == 0) {
    		$result->invalidate( $tag, "Field cannot be empty." );
    	}
    	
    	
    	return $result;
    

    Just to see it working. But seems email field is not checked?

    • This reply was modified 2 years, 2 months ago by mayy3321.
    • This reply was modified 2 years, 2 months ago by mayy3321.
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘wpcf7_validate_text* hook doesn’t work?’ is closed to new replies.