I’m building a front end form that creates a new post with wp_insert_post() via an AJAX handler. Once I’ve created the post ID, I then use a foreach loop to update_field().
issue: get_field_object() doesn’t work on the fields I created with update_field(). However, when I update in WP Admin, it works.
This is my AJAX handler: https://bitbucket.org/snippets/ChristopherArter/n4RRy and I’ve verified in the browser console that the javascript object is correct and that everything on that end is good.
I’ve got a posts management table that on the front end to display the posts created and it works great.. as long as the post was created or updated from the WP Admin. If not, the get_field_object() doesn’t work, and it’s a mess.
I took a look in the database, and you’ll see for post 949, the top image is what was saved to the database when I use the update_field() function and the AJAX handler above. The image below is what happens when I go into the WP Admin and hit “Update” on the very same post, which in turn, the get_field_object() works great and everything is good.
See the database here: http://imgur.com/a/y3moJ
I’m not really familiar with ACF, so I don’t know what that serialization on the end of the ‘field_’ identifier is..
Any suggestions on how to get this working as it does when I update from Admin?