Hi All.
I’m trying to use the function update_field to update a gallery.
I’m using this function:
$gallery=serialize($imageArray);
update_field(‘gallery’, $gallery, 2844);
The array serialized seams to be correct but every time i execute the code, the function empty the field instead of filling it with the serialized array (or even text)
Have you some suggestion?
Thank you
Tommaso
The problem is that you are serializing the array before you attempt to save it. This is not necessary. WP/ACF automatically does this when the value is saved. The value is getting double serialized.