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
Thanks for your explanation John!
However I think it’s not my problem: I never call
get_field() on update/create post process, I call
get_field() on page reload AFTER the process is completely finished (after several seconds, and after several reloads ^^). And I call
wp_post_update() BEFORE any ACF
update_field() (but there are ACF
get_field() calling before
wp_post_update() to populate data).
To briefly explain:
1. I call Airtable API (a Database/Excel like) to retrieve new data
2. Retrieve the WP Post from WP ID stored in Airtable
3. Populate Company PHP Object with existing data in WP (use
4. Update data in Company PHP Object with new data retrieved in Airtable (custom PHP)
5. Commit data in WP from new Company PHP Object with
wp_update_post() and (only after)
6. I go to the Company Page Edition in WP Back Office: All data are updated!
7. I check in database with an SQL Query: All data are updated correctly
8. I go to the Company Page in Front End to view modifications (so the PHP process is completely finished) by page reload (several reloads to be sure ^^), but nothing changed, old data are displayed :'( (no cache issue).
I think my issue doesn’t covered by your explanation, but I could be wrong 😶
I am currently developing a new getField() function, but if you have a secret sauce… 😁
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!
ACF PRO’s Flexible Content field allows you to create smaller pieces of UI and compose them into whole flexible patterns. In our latest article, we show how to use it to create swappable site sections and integrate it all in a theme.https://t.co/ZRocH8oJSp— Advanced Custom Fields (@wp_acf) January 24, 2023
© 2023 Advanced Custom Fields.