Support

Account

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.