Support

Account

Home Forums Bug Reports acf/update_value filters working improperly Reply To: acf/update_value filters working improperly

  • Alternatively, I used the get_post_meta() function inside acf/update_value. This give me “$original” value.
    Example:

    function my_acf_update_value( $value, $post_id, $field, $original ) {
    	
        $ex_meta = get_post_meta( $post_id, 'META_FIELD_NAME', true );
        
        if ( $ex_meta == 'SOME_EX_VAL' ) {
         # some code....
        }
        
        return $value;
    }
    
    add_filter('acf/update_value/name=date_expir', 'my_acf_update_value', 20, 4);