Home Forums General Issues Strange Behavior with field data and get_field Reply To: Strange Behavior with field data and get_field

  • Thank you for your help. I missed that part in the man page.

    I reviewed how I am updating records. This is how I am doing it;

    update_field($acf_field_name, $value, $post_id);

    The man page says $acf_field_name is the field name or field key.

    Now I see later in the man page, it says under “Updating via Field Key”,

    The field’s key should be used when saving a new value to a
    post (when no value exists). This helps ACF create the correct
    ‘reference’ between the value and the field’s settings.

    So only if the field has an existing value, can I use the acf name? If there is no value, (eg NULL), then I must use the KEY instead? Am I correct in saying that if one doesnt know if the field contains a value or not, then best to ALWAYS use the KEY?

    May I suggest an update to the man page at the top where it says, “is the field name or field key” to read “is the field name or field key, however, when updating new values, a KEY must be used instead of the name (see more below)”.. or something like that?

    BTW, I have fields in groups. For names I would need to concantenate group-name with field-name. I assume with fields, no need to do that, right?

    Thank you again.