Home › Forums › Bug Reports › Programmatically inserting field with update_field() does not at _field_key meta › Reply To: Programmatically inserting field with update_field() does not at _field_key meta
I’ve tried that and it doesn’t make any difference to me; It looks like the meta fields aren’t all set up unless you load the form in wp-admin then save it. I’m trying to find someway to replicate this entirely in code; Feels like need to replicate the setup when the form loads not just the save, but can’t get it.
Was there anything else you were doing in your function?
I create a post; update a couple of fields (some simple text, one a repeater) then call the acf/save_post action but there’s still nothing there when I pull back the post meta, until I load and save via the wp-admin user interface.
I read a post elsewhere saying that they were creating the JSON for the field structure and posting that but I’m not sure how to go about getting hold of that.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
2022 was a big year for Advanced Custom Fields, with more capabilities, a new generation of ACF Blocks, a refreshed UI, and a new home. Our year in review post looks at advancements we’ve made and offers a glimpse of the future.— Advanced Custom Fields (@wp_acf) January 6, 2023
© 2023 Advanced Custom Fields.