Support

Account

Home Forums General Issues update_field not updating fiel Reply To: update_field not updating fiel

  • Per the first post, I have echoed out the values being applied to the update_field() function and they are correct.

    I have tried this, too:

                if (update_field('field_64c782fc4c55d', 2, '1074')){
                    
                    echo "Success - ";
                    echo 'field_64c782fc4c55d: '.get_field(field_64c782fc4c55d, 1074);
                    echo '</br>';
                }

    As expected, it will not update is I keep 2 in there more than once. If I change 2 to another number, update_field is executed and the value of field_64c782fc4c55d is updated and get_field returns the updated value.

    I then go to the view of my custom post type and the value is never update. For instance, if I update the via the view of field field_64c782fc4c55d and I enter 7, the number never changes despite executing the above code.

    So then it means the view is not right. I inspected the html and it shows;

    <div class="acf-input-wrap"><input type="number" id="acf-field_64b38c4e3ec56-field_64c782fc4c55d" name="acf[field_64b38c4e3ec56][field_64c782fc4c55d]" value="7" step="any"/></div></div>
    </div>

    The id is acf-field_64b38c4e3ec56-field_64c782fc4c55d which is myFieldGroupName-FieldKey

    Is that the way it should be working? There is not a description in the man pages and I would hate to start digging through the ACF code.