Support

Account

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 get_field())
    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) update_field().
    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… 😁