Support

Account

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

  • I have duplicated this problem on a new & clean WP install. Here are the steps:
    1. Download WP from WP.org
    2. Install
    3. Add ACF plugin
    4. Add custom field group ‘foo’ with one text field ‘foo’
    5. edit functions.php for active theme and add the code from my previous post
    6. Add new post. See ‘foo’ field. Save new post. Filter does not run.
    7. change functions.php top to use acf/validate_save_post

    add_filter('acf/validate_save_post', 'my_acf_validate_value', 10, 0 );
    
    function my_acf_validate_value(  ){
    
    	return "is that working?";
    }

    8. Add new post and filter does not run
    9. Change functions.php top to use acf/save_post

    add_action('acf/save_post', 'my_acf_validate_value', 10, 0);
    
    function my_acf_validate_value(  ){
    
    	exit( 'save post' );
    }

    10. Add new post and action DOES run

    I have observed this with WP 4.9.4 and 4.8.5

    I have verified with this technique that the function is hooked — but it is not running. I have tried changing the priority up and down and that does not help.

    Please help. How do I get a the acf/validate_ filters to go? thank you!