It seems that I can fix this weird issue, when I do the following:
update_field(‘some_json’, json_encode($array), $post_id);
update_post_meta($post_id, ‘_some_json’, ‘some_json’, ‘field_some_json’);
After renaming the Value from “field_some_json” to “some_json”, I can access it with get_field(‘some_json’); again.
Hi @elliot,
Thank you for your response. My problem does still exist.
Before you run the update_field function, does the post already have a value for some_json?
Yes, the post already has a value for some_json.
If so, was that value saved through the ACF interface?
No, I have set it via PHP with update_field(), as described in my first post.
Can you confirm that the correct field reference is saved under the value in the database?
The Key in my database is currently “temp_key_for_some_json”. With 4.1.8.1 is being renamed to “field_some_json” (when saving that post) and after that I cannot access the fields contents any longer with get_field(“some_json”).
My Field in the Database “temp_key_for_some_json” is being renamed in 4.1.8.1 to “field_some_json” (when saving that post) and after that I cannot access the fields contents any longer with get_field(‘some_json’). Why not?
It might be a similar issue as it is in http://support.advancedcustomfields.com/forums/topic/get_field-cant-retrieve-new-post-saved-with-update_field-in-acf-4-1-8/ as the field_key is “temp_key_for_some_json”.
How can I achieve that the Key is “some_json” and not “temp_key_for_some_json”? I have created the field “some_json” through PHP and not the GUI.
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.