Support

Account

Home Forums General Issues validate_value filter doesn't work Reply To: validate_value filter doesn't work

  • Hi John thank you for your help,

    The semicolon was missing only here in my question, I didn’t miss it in the actual code.
    And it is still not working.

    I just want to know that I understand that correctly – If I put the above code in function.php, everytime that I try to save post with acf fields in it I should get error message saying “is that working?” and the post shouldn’t be saved, right?

    Right now it’s not working, I put the following code in functions.php, and the posts saves successfully.

    add_filter('acf/validate_value', 'my_acf_validate_value', 10, 4);
    
    function my_acf_validate_value( $valid, $value, $field, $input ){
    
    	return "is that working?";
    }

    EDIT:

    Just try to run this in order to check if my site is even response to the code

    add_action('acf/validate_save_post', 'my_acf_validate_value', 10, 0);
    
    function my_acf_validate_value(  ){
    
    	die();
    }

    And the posts still saves as usual..
    I don’t know if that’s related but I registered the fields manually via php..