Home Forums General Issues update_field not updating fiel Reply To: update_field not updating fiel

  • Did you read the solution I gave in the other topic?
    Here it is adapted for your field keys

    // initialize row value just in case the loop returns noting
    $row = array();
    // loop group field and get existing values
    if (have_rows('field_64b38c4e3ec56', $post_id)) {
      // this is always true once
      while (have_rows('field_64b38c4e3ec56', $post_id)) {
        // this loop always happens 1 time for a group field
        // *********************************************************
        // little known fact
        // the_row() returns an array holding the row
        // with field keys as indexes and unformatted field values
        // *********************************************************
        $row = the_row();
    // set a new value for the "sub field" that needs to be updated.
    $row['field_64c782fc4c55d'] = 'value you want to update to here';
    // update the group field
    update_field('field_64b38c4e3ec56', $row, $post_id);