Support

Account

Home Forums Front-end Issues Retrieve all field options in admin Reply To: Retrieve all field options in admin

  • Hey John,
    acf_get_field() sounds good but still not the right values. After investigation, here’s what i discovered:

    When used in my theme file header.php acf_get_field retrieves those choices:

    
    [choices] => Array
            (
                [casa] => Casa
                [apartamento] => Apartamento
                [loft] => Loft
                [cobertura] => Cobertura
                [duplex] => Duplex
                [beiramar] => Beira-Mar
            )
    

    and when using the Export Field Groups to PHP tool in the admin, here’s what i get:

    
    'choices' => array (
      'ap' => 'AP',
      'apartamento' => 'Apartamento',
      'loft' => 'Loft',
      'cobertura' => 'Cobertura',
      'duplex' => 'Duplex',
      'fazenda' => 'Fazenda',
      'beiramar' => 'Beira-Mar',
      'haras' => 'Haras',
      'andar' => 'Andar',
      'sala' => 'Sala',
      'terreno' => 'Terreno',
    ),
    

    All the choices.

    Crazy thing, [key] and [name] are identical.

    Any reason you could think of that would trigger this behavior?