Why when you programmatically add a post ACF fields do not appear?

Add via post $post_ID = wp_insert_post($source); By ID fill out the field ACF, but they never appear. Open post fields are populated, the status Published. Click the Publish button and everything works.
July 4th 19 at 23:02
2 answers
July 4th 19 at 23:04
As far as I remember, adding ACF fields so you need to use the key field, not the name. Keys look like this: field_56032f2c65c16
update_field( 'field_56032f2c65c16', 'text', $post_id );

To see the keys of Your fields, go to the ACF, open the group you want in the Settings screen in the upper right corner to enable the option "Show field key".
July 4th 19 at 23:06
Works! Thank you.

Think like logical, but it turns out as always ))

Find more questions by tags WordPress