Support

Account

Home Forums General Issues Repeater field + Auto populate select Reply To: Repeater field + Auto populate select

  • Hi,

    I’m not able to make this work.
    I have added:

    function my_acf_load_field2( $field )
    {
        $field['choices'] = array(
            'custom' => 'My Custom Choice'
        );
     
        return $field;
    }
     
     
    // acf_load_field-{$field_key} - filter for a specific field based on it's key
    add_filter('acf_load_field-field_520fa5c4c3ce6', 'my_acf_load_field2');

    to my functions.php, but it doesn’t work.
    I’m trying to populate select field:

    <select id="acf-field-reserve_country" class="select" name="fields[field_520fa5c4c3ce6]">

    I use ACF as a plugin.
    Doing something wrong?