I am trying to use update_field to change checkbox selections, but I can’t get it to work. I tried the following, but nothing is updated.
$newchoices = array ( 'ID' => 4844, 'key' => 'field_576d194037bae', 'label' => 'Progression', 'name' => 'byggeri_progression', 'prefix' => '', 'type' => 'checkbox', 'value' => array ( 0 => 'Checkbox 1', 1 => 'Checkbox 3', 2 => 'Checkbox 5'), 'menu_order' => 29, 'instructions' => '', 'required' => 0, 'id' => '', 'class' => '', 'conditional_logic' => 0, 'parent' => 4814, 'wrapper' => array ( 'width' => '', 'class' => '', 'id' => '', ), '_name' => 'progression', '_input' => '', '_valid' => 1, 'choices' => array ( 'Choice 1' => 'Choice 2', 'Choice 3' => 'Choice 4', 'Chocie 5'), 'default_value' => array ( ), 'layout' => 'vertical', 'toggle' => 0, );
update_field( 'field_576d194037bae', $newchoices, 4877);
What am I doing wrong?