Support

Account

Home Forums Backend Issues (wp-admin) Programmatically add relationship field data Reply To: Programmatically add relationship field data

  • A relationship field holds and array of ID values

    
    // if the might already have a value
    $value = get_field('field_63d65a709cc93', $post_id);
    if (empty($value)) {
      $value = array();
    }
    $value[] = intval(rgar($entry,'17'););
    update_field('field_63d65a709cc93', $value, $post_id);