Hi,
when I insert a new post from front end to a select field array gets a key like this:
Array ( [0] => Array ( [value] => pending [label] => Pending ) );
but when the post is updated using wp_update_post(); the key somehow gets removed like this:
Array ( [value] => declined [label] => Decline );
Why is that and how can I get values without the key to began with.
Thanks.
@mysticalghoul is this an ACF specific question? It seems like this is more of a WordPress question. I would try asking it here: https://wordpress.stackexchange.com/
@nathanaelphilip I think you are right but still its baffling how it changes on second time the post is saved.
OK I solved it by updating select field using value directly instead of using as array.
$field_key = "field_5a70533ef099f";
$value = "req-pending";
update_field( $field_key, $value, $post );
Now it works fine.