Support

Account

Forum Replies Created

  • 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!

  • I am experiencing exactly the same problem reported here. My validate value filters never get called. They are in my theme functions.php file and I have used the code provided above.

    I am seeing acf/save_post work correctly btw. But acf/validate_value never does anything. Any help please? How do I debug this.

    I am running a brand new WP site (as of a week ago) on PHP 5.4

    To isolate this issue I dropped my child theme and I am using plain twentyseventeen. The only change is the top of functions.php as shown here

    <?php
    
    add_filter('acf/validate_value', 'my_acf_validate_value', 10, 4);
    
    function my_acf_validate_value( $valid, $value, $field, $input ){
    
    	return "is that working?";
    }
    
    /**
     * Twenty Seventeen functions and definitions
     *
     * @link https://developer.wordpress.org/themes/basics/theme-functions/
     *
     * @package WordPress
     * @subpackage Twenty_Seventeen
     * @since 1.0
     */
Viewing 2 posts - 1 through 2 (of 2 total)