Support

Account

Home Forums Bug Reports Formatting being ignored for default field values. Reply To: Formatting being ignored for default field values.

  • The reason this happens and why formatting is suppressed is because ACF will not be able to know how to format the value, or event that the field has a default value. acf_maybe_get_field() is looking for at valid field in order to get the field key. If you look into `acf_get_value()’ you’ll find that it’s using the field key to get the value.

    If you have a field and you know that that field will not have any values saved because of things like added the field after the posts were created by using the field key to get the value rather than the field name you will get the default value and it will be formatted. The same issue exists when getting values that have never been set as is described when updating values that have never existed using update_field() https://www.advancedcustomfields.com/resources/update_field/