Support

Account

Home Forums ACF PRO Programmatic post insertion, ACF fields, and the save_post hook Reply To: Programmatic post insertion, ACF fields, and the save_post hook

  • Hey @elliot, thanks for stopping by.

    The update_field documentation you have just provided is precisely the situation I’m dealing with, and it helped me sort this out in the past. There is a new problem since upgrading to v5 however! Previously, data could be saved properly by using the field_key and users would be able to immediately view the front end and see the content that was retrieved using the field_name. Now with v5, the data is not visible on the front end unless each post is manually updated after populating the ACF fields. Interestingly, get_field($field_key) is not working either.

    Was there a change to the way that update_field() performs in respect to the save_post hook?

    In regards to the updated field keys – closer investigation reveals that the keys were simply updated for a few fields, no fields had duplicate keys. This makes sense though – the field keys that changed were those belonging to Repeater and Gallery fields… I would expect that the new v5 system recreated the fields in migration ๐Ÿ™‚