I’ve been trying to update a Post Object field for a while now, but I haven’t had any luck.
I do call update_field() and my $value is an array
This code is within a foreach loop, that iterates over some db records:
I think you are trying to pass an array in the update field function and you haven’t defined a field. I think you need to pass a number to the post object. You may want to add another variable to get the page ID.
Whatever $nombre_cargo is, you need to use the field name or field key as the first parameter of the update field function. For example: ‘nombre_cargo’ or ‘field_123456890’
Try this, but replace the name of the field first.