Support

Account

Home Forums ACF PRO How to prevent save some fields values on post update?

Solved

How to prevent save some fields values on post update?

  • I want to prevent save value for acf fields when I update post

  • I use this

    function prevent_save_acf_value($value, $post_id, $field) {
        return get_field($field['name'], $post_id);
    }
    add_filter('acf/update_value/key=field_5a82bff5e7421', 'prevent_save_acf_value', 10, 3);

    But I thinks there should be more nice way =)

  • Also I see this it works

    function disable_acf_field( $field ) {
        $field['disabled'] = 1;
        return $field;
    }
    add_filter('acf/prepare_field/name=duration_to_next_point', 'disable_acf_field');
Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘How to prevent save some fields values on post update?’ is closed to new replies.