Support

Account

Home Forums General Issues Default values by option page on first load Reply To: Default values by option page on first load

  • You either need to use update_field() to set defaults for every field when the theme is set up https://www.advancedcustomfields.com/resources/update_field/ or check the values and if nothing is returned then assume the default.

    
    $value = get_field('my_options', 'option');
    if ($value === NULL) {
      $value = 'my-default-value';
    }
    

    I prefer the second method.