Home › Forums › Backend Issues (wp-admin) › update_field() issues › Reply To: update_field() issues
Update: Actually, I was wrong about the result of get_field()
after running the script. What I reported was actually the result of get_field()
only after running the update_sub_field()
function.
However what is actually happening is weird. In the database, the result of running the script on un-saved posts is that the wp_postmeta table entries have some issues.
Here’s what the correct database entries look like (meta_key and meta_value entries):
_repeater_name..........................repeater_field_key
repeater_name............................1
_repeater_name_0_sub_field_name..........sub_field_key
repeater_name_0_sub_field_name...........$value
But here’s what I get:
_repeater_name..........................
repeater_name............................a:1:{i:0;a:1:{s:16:"sub_field_name...
_repeater_name_0_sub_field_name..........
repeater_name_0_sub_field_name...........$value
So instead of the row count, the repeater_name entry has a serialized array of the sub fields and all the field keys are missing.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.