Support

Account

Home Forums Backend Issues (wp-admin) Getting the values from a custom field Reply To: Getting the values from a custom field

  • A relationship field holds an array of post IDs. In order to add a value you need to first get the existing value and add to it. Example:

    
    $value = get_field('field_5628165af3668', $post_id);
    $value[] = '777';
    update_field('field_5628165af3668', $value, $post_id);