Support

Account

Home Forums Bug Reports wp_insert_post && update_field Reply To: wp_insert_post && update_field

  • This is because there is no field key reference stored in the database for the field. Most basic fields that store only a text string will work, but most of the advance type fields, anything not listed under “Basic” when creating the field will probably not work with only a few exceptions.

    In order to use update field for new posts where ACF fields do not yet exist you must use the field key when calling update field instead of the field name. This is explained in the update_field() documentation https://www.advancedcustomfields.com/resources/update_field/