Support

Account

Home Forums General Issues Headless WordPress: ACF fields return empty once a post is created with WP-API Reply To: Headless WordPress: ACF fields return empty once a post is created with WP-API

  • Had the same issue, but for creating a new post using automated functions. So created this function that gets all the fields with their defaults values and updates the post metadata.

    https://gist.github.com/dfinnema/da4c6afdff2eaa4274f3709585d80c8e

    Make sure you run this only after creating the new post and before adding data to it.